Core Function ThreadState

From Sputnik Wiki
(Difference between revisions)
Jump to: navigation, search
(Created page with "<pre> ThreadState( <name> ) </pre> === Description === Returns state of a thread === Parameters === ==== name ==== Name of a thread to check. === Return Value === Success:...")
 
m (1 revision)
 
(One intermediate revision by one user not shown)

Latest revision as of 12:38, 14 June 2015

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