Core Function ThreadName

From Sputnik Wiki
Jump to: navigation, search
ThreadName( )

Contents

Description

Returns the name of the current thread that is executing this code

Parameters

None

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();");
 
inputc();
 
Function ThreadFunc()
{
	while(true)
	{
		println("Hello from thread '" . ThreadName() . "'");
		sleep(1000);
	}
}
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox