Core Function ThreadResume

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

Contents

Description

Unfreeze a thread and allow it to continue execution

Parameters

name

Name of a thread to resume.

Return Value

Success: Returns 1.

Failure: Returns 0.

Remarks

None

Example

ThreadCreate("th1", "ThreadFunc();");
ThreadCreate("th2", "ThreadFunc();");
ThreadCreate("th3", "ThreadFunc();");
 
println("Lets sleep 2 seconds...");
sleep(2000);
println("Lets make thread 2 sleep...");
ThreadSleep("th2");
println("Thread 2 is sleeping.... Now lets sleep for 3 seconds");
sleep(3000);
ThreadResume("th2");
println("Thread 2 is now resumed");
 
inputc();
 
Function ThreadFunc()
{
	while(true)
	{
		println("Hello from thread '" . ThreadName() . "'");
		sleep(500);
	}
}
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox