|Navigation: Language Reference > 13 - Built-in Functions >====== THREADLOCKED (returns current execution thread locked state) ======|
The THREADLOCKED procedure returns the current execution thread's locked/unlocked state. It returns zero (0) if the thread is unlocked and one (1) if the thread is locked.
Return Data Type: SIGNED
X# = THREADLOCKED() !Returns 1
UNLOCKTHREAD !Unlock the thread
X# = THREADLOCKED() !Returns 0
MyLibraryCodeWithMessageLoop !Call the code that has its own message loop
LOCKTHREAD !Re-lock the thread