ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Standard functions / Process functions / Threads, semaphores, signals and mutex
  • Summary table about the operating mode of event
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Modifies the status of an event.
Example
// Création d'un signal
EventCreate("Allez-y", eventManual, eventClose)
// Exécution d'un premier thread
ThreadExecute("Thread1", threadNormal, "Thread_Premier")
// Bloque le thread en cours jusqu'à l'obtention du signal
ThreadWaitSignal()

// Exécution d'un second thread
ThreadExecute("Thread2", threadNormal, "Thread_Second")
// Bloque le thread en cours jusqu'à l'obtention du signal
ThreadWaitSignal()

// Modifie le signal pour exécuter les threads
EventChange("Allez-y", eventOpen)
//----------------------------------------------
PROCEDURE Thread_Premier()
Trace(dbgInfo(dbgProcess) + " - ThreadEnvoieSignal(threadPrincipal)")
ThreadSendSignal(threadMain)
EventWait("Allez-y")
Trace(dbgInfo(dbgProcess) + " - Signal reçu")
//--------------------------------------------
PROCEDURE Thread_Second()
Trace(dbgInfo(dbgProcess) + " - ThreadEnvoieSignal(threadPrincipal)")
ThreadSendSignal(threadMain)
EventWait("Allez-y")
Trace(dbgInfo(dbgProcess) + " - Signal reçu")
Syntax
EventChange(<Event> [, <New status>])
<Event>: Character string
Name of the event to modify. If this event does not exist, it is automatically created with the default options (automatic mode) and in the specified status.
<New status>: Optional constant
Status of the event:
eventCloseCloses the event.
This constant is equivalent to EventClose.
eventOpen
(Default value)
Opens the event. If threads are waiting for the event, they are automatically unlocked.
This constant is equivalent to EventOpen.
eventOpenAndCloseOpens the event, unlocks all the pending threads and closes the event. This constant is not recommended. It is kept for backward compatibility.
Remarks

Summary table about the operating mode of event

Value of EventChangeAutomatic event (by default)Manual event
eventOpenA single thread is processed by the event.
The event is automatically closed once the thread is processed.
Waiting threads If no thread was waiting, the signal remains open until the next thread passes, then closes again.
New threads If more threads arrive, they are put on hold.
The event is opened.
Waiting threads: All waiting threads pass through.
New threads: If other threads arrive while the signal is still open, they pass.
eventOpenAndClose This constant is not recommended. It is kept for backward compatibility.A single thread is processed by the event.
The event is automatically closed once the thread is processed.
Waiting threads If no thread is waiting, the signal remains closed.
New threads If more threads arrive, they are put on hold.
All the threads are processed by the event.
The event is automatically closed once all the threads are processed.
New threads If more threads arrive, they are put on hold.
eventCloseThe event remains closed.
New threads If more threads arrive, they are put on hold.
The event is closed.
New threads If more threads arrive, they are put on hold.
Component: wd300vm.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/27/2025

Send a report | Local help