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 AutomaticEvent 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 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.
Ejemplo
// MAIN THREAD
//------------------
// Define the event
s is AutomaticEvent
// 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
// ----------------------
PROCEDURE ProcThread(s)

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

Declaring an automatic event (simple syntax) Ocultar los detalles

MyVariable is AutomaticEvent
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:
eventOpenThe event is open when it is created.
eventCloseThe event is closed when it is created.
Observaciones

Using the AutomaticEvent variables

The AutomaticEvent variables can be used to synchronize threads in functions:
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