Core Function ThreadState

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

Contents

Description

Returns state of a thread

Parameters

name

Name of a thread to check.

Return Value

Success: Returns the threads state as a string.

Failure: Returns an empty string.

Remarks

Possible states are: Running Sleeping Suspended SuspendRequested Unstarted Stopped StopRequested Background Aborted AbortRequested

Example

ThreadCreate("th1", "ThreadFunc();");
ThreadCreate("th2", "ThreadFunc();");
ThreadCreate("th3", "ThreadFunc();");
 
println("Thread 1 state " . ThreadState("th1")  );
println("Thread 2 state " . ThreadState("th2")  );
println("Thread 3 state " . ThreadState("th3")  );
 
inputc();
 
Function ThreadFunc()
{
	while(true)
	{
		sleep(1000);
	}
}
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox