|
|
|
|
|
<AutomaticEvent variable>.Wait (Function) In french: <Variable SignalAutomatique>.Attend Locks the current thread while waiting for the specified event to be opened.
Signal_Allezy is AutomaticEvent(eventClose)
ThreadExecute("Thread1", threadNormal, "Thread_Premier")
ThreadWaitSignal()
ThreadExecute("Thread2", threadNormal, "Thread_Second")
ThreadWaitSignal()
Signal_Allezy.Ouvre()
PROCEDURE Thread_Premier()
Trace(dbgInfo(dbgProcess) + " - ThreadEnvoieSignal(threadPrincipal)")
ThreadSendSignal(threadMain)
Signal_Allezy.Attend()
Trace(dbgInfo(dbgProcess) + " - Signal reçu")
PROCEDURE Thread_Second()
Trace(dbgInfo(dbgProcess) + " - ThreadEnvoieSignal(threadPrincipal)")
ThreadSendSignal(threadMain)
Signal_Allezy.Attend()
Trace(dbgInfo(dbgProcess) + " - Signal reçu")
Syntax
<Result> = <Event>.Wait([<Maximum duration>])
<Result>: Integer - 1 if the event was received by the thread,
- 0 otherwise (maximum duration exceeded).
<Event>: AutomaticEvent variable Name of the AutomaticEvent variable that corresponds to the event to wait for. <Maximum duration>: Optional integer or optional Duration Maximum timeout in hundredths of a second. - If no signal was received by the thread before the end of specified duration, <Result> is equal to False.
- The timeout is endless if this parameter is not specified.
- If this parameter is set to 0, <Result> corresponds to the status of the event, without waiting.
This parameter can correspond to: - an integer corresponding to the number of hundredths of a second,
- a Duration variable,
- the duration in a readable format (e.g., 1 s or 10 ms).
Remarks You can end the execution of a thread even if it is locked in an endless wait for an event. Simply use ThreadStop.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|