AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Funciones WLanguage / Funciones estándar / Funciones de gestión de procesos / Hilos, semáforos, señales y mutex
  • Declaration
  • Using the ManualEvent variables
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
The ManualEvent type is used to manage a manual event. A manual event is used to simplify the synchronization between several threads.
A manual event can only be modified by EventChange.
Note: It is preferable to use a variable of type AutomaticEvent or ManualEvent variable to create a signal, rather than naming it using a string. Indeed, using a variable allows you to:
  • manage the variable scope,
  • avoid having 2 events with the same name in 2 different threads.
Ejemplo
// MAIN THREAD
//------------------
// Define the event
s is ManualEvent
// Start the thread
ThreadExecute("Thread", threadNormal, ProcThread, s)
// Code in parallel with the thread
...
// Wait for the event triggered by the thread
EventWait("s")
// SECONDARY THREAD
// ----------------------
PROCÉDURE ProcThread(s)

// Code in the thread
...
// Unlocks the main thread
EventOpen(s)
Declaration

Declaring a manual event (simple syntax) Ocultar los detalles

MyVariable is ManualEvent
In this case, the manual event is closed when it is created.

Declaring a manual event (advanced syntax) Ocultar los detalles

MyVariable is ManualEvent(<Initial status>)
<Initial status>: Integer constant
Initial status of the event:
eventOpenThe event is open when it is created.
eventCloseThe event is closed when it is created.
Observaciones

Using the ManualEvent variables

The ManualEvent variables can be used to synchronize threads in the functions:
When calling the EventOpen (or <ManualEvent variable>.Open) function, the signal remains open:
  • all the pending threads are freed,
  • all the threads that will reach the event later will go through without waiting.
When calling the EventClose (or <ManualEvent variable>.Close) function, the signal is closed: all threads reaching the signal remain blocked.
Versión mínima requerida
  • Versión 20
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 27/03/2025

Señalar un error o enviar una sugerencia | Ayuda local