|
|
|
|
|
- Declaration
- Using the AutomaticEvent variables
AutomaticEvent (Variable type)
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 AutomaticEvent or ManualEvent variable 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)
In this case, the automatic event is closed when it is created.
Declaring an automatic event (advanced syntax) Ocultar los detalles
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. |
Observaciones 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 | Bloquea el hilo actual mientras espera a que se abra el evento especificado. |
- prefix syntax:
Esta página también está disponible para…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|