ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / Process functions / Threads, semaphores, signals and mutex
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Opens a synchronization event between several threads.
Example
// Create an event
LetsGo is eventAutomatic
 
// Run a first thread
ThreadExecute("Thread1", threadNormal, "Thread_First")
// Locks the current thread until the event is obtained
ThreadWaitSignal()
 
// Run a second thread
ThreadExecute("Thread2", threadNormal, "Thread_Second")
// Locks the current thread until the event is obtained
ThreadWaitSignal()
 
// Opens the event to run the threads
EventOpen(LetsGo)
PROCEDURE Thread_First()
Trace(dbgInfo(dbgProcess) + " - ThreadSendSignal(threadMain)")
ThreadSendSignal(threadMain)
EventWait("LetsGo")
Trace(dbgInfo(dbgProcess) + " - Event received")
PROCEDURE Thread_Second()
Trace(dbgInfo(dbgProcess) + " - ThreadSendSignal(threadMain)")
ThreadSendSignal(threadMain)
EventWait("LetsGo")
Trace(dbgInfo(dbgProcess) + " - Event received")
Syntax
EventOpen(<Event>)
<Event>: Character string, or AutomaticEvent or ManualEvent variable
Name of the event to open. This name can correspond to:
Remarks
  • This function is equivalent to the following syntax of EventChange:
    EventChange(<Event>, eventOpen)
  • For an automatic event: A single thread is processed by the event.
    The event is automatically closed once the thread is processed.
    • Pending threads: If there is no pending thread, the event remains open until the next thread, then it is closed.
    • New threads: The new threads are added to the pending queue.
  • For a manual event: The event is opened.
    • Pending threads: All the pending threads are processed.
    • New threads: If other threads arrive while the event is still open, they are processed.
Business / UI classification: Neutral code
Component: wd300vm.dll
Minimum version required
  • Version 20
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 06/21/2023

Send a report | Local help