Core Function ThreadExists

From Sputnik Wiki
Jump to: navigation, search
ThreadExists( <name> )

Contents

Description

Check if a thread exists by this name

Parameters

name

Name of a thread to check.

Return Value

Success: Returns the name of the current thread.

Failure: Returns an empty string.

Remarks

None.

Example

ThreadCreate("th1", "ThreadFunc();");
ThreadCreate("th2", "ThreadFunc();");
ThreadCreate("th3", "ThreadFunc();");
 
println("Thread th1 " . (ThreadExists("th1") ? "Does exist" : "Does not exist"));
println("Thread th4 " . (ThreadExists("th4") ? "Does exist" : "Does not exist"));
 
 
inputc();
 
Function ThreadFunc()
{
	while(true)
	{
		sleep(1000);
	}
}
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox