|
|
|
|
- Mode for sharing the events
EventCreate (Function) In french: SignalCrée Creates an event. An event is used to synchronize several threads at the same time. If the event is open, all the threads waiting for the event are unlocked.
EventCreate("Let's go", eventManual, eventClose)
ThreadExécute("Thread1", threadNormal, "Thread_First")
ThreadWaitSignal()
ThreadExécute("Thread2", threadNormal, "Thread_Second")
ThreadWaitSignal()
EventChange("Let's go", eventOpen)
PROCÉDURE Thread_First()
Trace(dbgInfo(dbgProcess) + " - ThreadSendSignal(threadMain)")
ThreadSendSignal(threadMain)
EventWait("Let's go")
Trace(dbgInfo(dbgProcess) + " - Event received")
PROCÉDURE Thread_Second()
Trace(dbgInfo(dbgProcess) + " - ThreadSendSignal(threadMain)")
ThreadSendSignal(threadMain)
EventWait("Let's go")
Trace(dbgInfo(dbgProcess) + " - Event received")
Syntax
EventCreate(<Event> [, <Mode> [, <Initial status> [, <Options>]]])
<Event>: Character string Name of the event to create. This name will be used by all the event management functions. <Mode>: Optional constant Mode for managing the event: | | eventAutomatic (Default value) | After its opening, the event is automatically closed as soon as a single thread is unlocked. | eventManual | The event is modified by EventChange. |
<Initial status>: Optional constant Initial status of the event: | | eventClose (Default value) | The event is closed when it is created. | eventOpen | The event is open when it is created. |
<Options>: Optional Integer constant - Mode for sharing the event:
| | shareGlobal | The event is shared between all the applications found on the computer.
| shareNone | The event is specific to the application. If EventDestroy is not called, the event is destroyed at the end of the application.
| shareUser (Default value) | The event is shared between all the applications of the session of the user who runs the application.
|
- Mode for destroying the event:
| | DestructionWithoutModification | By default, an event is automatically modified during its destruction. If the event is created with the DestructionWithoutModification constant, it will not be modified during the call to EventDestroy or during the automatic destruction of the event when closing the application.
|
The information regarding the share mode and the destruction mode of the event can be combined.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|