|
|
|
|
Abre una sincronización Event entre varios hilos. // Create an event Event_Letsgo is AutomaticEvent(eventClose) // 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 Event_Letsgo.Open()
PROCEDURE Thread_First() Trace(dbgInfo(dbgProcess) + " - ThreadSendSignal(threadMain)") ThreadSendSignal(threadMain) Event_Letsgo.Wait() Trace(dbgInfo(dbgProcess) + " - Event received") PROCEDURE Thread_Second() Trace(dbgInfo(dbgProcess) + " - ThreadSendSignal(threadMain)") ThreadSendSignal(threadMain) Event_Letsgo.Wait() Trace(dbgInfo(dbgProcess) + " - Event received") Sintaxis <Event>: AutomaticEvent Variable Nombre de una Variable de tipo AutomaticEvent que se va a abrir. Observaciones - Esta función equivale a la siguiente sintaxis de EventChange:
EventChange(<Event>, eventOpen) - Para un automatic Event: Un solo hilo es procesado por la Event.
La Event se cierra automáticamente una vez que se procesa la el hilo. - Hilos pendientes: Si no hay ningún Thread pendiente, el Event permanece abierto hasta el próximo Thread, entonces se cierra..
- Temas nuevos: Los nuevos temas se añaden a la cola de espera.
Clasificación Lógica de negocio / UI: Código neutro
Esta página también está disponible para…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|