| **Navigation:**  [[introduction.htm|Language Reference]] > 13 - Built-in Functions >====== LOCKTHREAD (re-lock the current execution thread) ====== | [[lock exclusive file access .htm|{{btn_prev_n.gif|Previous page}}]][[introduction.htm|{{btn_home_n.gif|Return to chapter overview}}]][[log10 return base 10 logarithm .htm|{{btn_next_n.gif|Next page}}]] | | || **LOCKTHREAD** {{blk2blue.jpg|blk2blue.jpg}} The **LOCKTHREAD** statement re-locks the current execution thread that has been unlocked with the UNLOCKTHREAD statement. The THREADLOCKED() procedure determines whether the thread has been unlocked or not. **Example:** ** UNLOCKTHREAD                   !Unlock the thread** ** MyLibraryCodeWithMessageLoop   !Call the code that has its own message loop** ** LOCKTHREAD                     !Re-lock the thread** **See Also:** [[accept the event processor .htm|ACCEPT]] [[unlockthread unlock the current execution thread .htm|UNLOCKTHREAD]] [[threadlocked returns current execution thread locked state .htm|THREADLOCKED]]