|
|
|
|
|
- Declaration
- Using the AutomaticEvent variables
AutomaticEvent (Variable type) In french: SignalAutomatique
The AutomaticEvent type is used to manage an automatic event. An automatic event is used to simplify the synchronization between several threads. After its opening, an "Automatic" event is automatically closed as soon as a single thread is unlocked. Note: It is preferable to use a variable of type SignalAutomatique or ManualEvent to create a signal, rather than naming it using a character string.. Indeed, using a variable allows you to: - manage the variable scope,
- avoid having 2 events with the same name in 2 different threads.
s is AutomaticEvent
ThreadExecute("Thread", threadNormal, ProcThread, s)
...
EventWait(s)
PROCEDURE ProcThread(s)
...
EventOpen(s)
Declaring an automatic event (simple syntax) Hide the details
MyVariable is AutomaticEvent
In this case, the automatic event is closed when it is created.
Declaring an automatic event (advanced syntax) Hide the details
MyVariable is AutomaticEvent(<Initial state>)
<Initial state>: Integer constant Initial status of the event:
| | eventOpen | The event is open when it is created. | eventClose | The event is closed when it is created. |
Remarks Using the AutomaticEvent variables The AutomaticEvent variables can be used to synchronize threads in functions: - standard syntax:
| | EventClose | Closes a synchronization event between several threads. | EventOpen | Opens a synchronization event between several threads. | EventWait | Locks the current thread while waiting for the specified event to be opened. |
- prefix syntax:
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|