PauseThread()

Syntax

PauseThread(Thread)
Description
Pauses the execution of the specified thread, previously created with CreateThread(). The thread can be resumed with ResumeThread().

Parameters

Thread - The number of the thread you want to pause. This value is returned by CreateThread().

Example:

  Procedure PrintStuff(dummy)
    For i = 0 To 10
      PrintN(".")
      Delay(200)
    Next
  EndProcedure
  
  If OpenConsole()
    thread = CreateThread(@PrintStuff(), 0)
    If thread
      Delay(100)
      PauseThread(thread)
      For i = 0 To 10
        PrintN("A")
        Delay(50)
      Next
      
      ; Resume thread and give it enough time to complete
      ResumeThread(thread)
      Delay(3000)
    EndIf
  EndIf

Supported OS

All

<- LockMutex() - Thread Index - ResumeThread() ->