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) |
(One intermediate revision by one user not shown) |
Latest revision as of 12:38, 14 June 2015
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); } }