Core Function ThreadExists
From Sputnik Wiki
(Difference between revisions)
(Created page with "<pre> ThreadExists( <name> ) </pre> === Description === Check if a thread exists by this name === Parameters === ==== name ==== Name of a thread to check. === Return Value ...") |
m (1 revision) |
Revision as of 21:40, 11 August 2014
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); } }