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
  • Mode for sharing the events
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
Creates an event. An event is used to synchronize several threads at the same time. If the event is open, all the threads waiting for the event are unlocked.
Ejemplo
// Create an event
EventCreate("Let's go", eventManual, 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()

// Modifies the event to run the threads
EventChange("Let's go", eventOpen)
//----------------------------------------------
PROCEDURE Thread_First()
Trace(dbgInfo(dbgProcess) + " - ThreadSendSignal(threadMain)")
ThreadSendSignal(threadMain)
EventWait("Let's go")
Trace(dbgInfo(dbgProcess) + " - Event received")
//--------------------------------------------
PROCEDURE Thread_Second()
Trace(dbgInfo(dbgProcess) + " - ThreadSendSignal(threadMain)")
ThreadSendSignal(threadMain)
EventWait("Let's go")
Trace(dbgInfo(dbgProcess) + " - Event received")
Sintaxis
EventCreate(<Event> [, <Mode> [, <Initial status> [, <Options>]]])
<Event>: Character string
Name of the event to create. This name will be used by all the event functions.
<Mode>: Optional constant
Mode for managing the event:
eventAutomatic
(Default value)
After its opening, the event is automatically closed as soon as a single thread is unlocked.
eventManualThe event is modified by EventChange.
<Initial status>: Optional constant
Initial status of the event:
eventClose
(Default value)
The event is closed when it is created.
eventOpenThe event is open when it is created.
<Options>: Optional Integer constant
  • Mode for sharing the event:
    shareGlobalThe event is shared between all the applications found on the computer.
    AndroidWidget Android iPhone/iPadApple WatchJava This constant is not available.
    shareNoneThe event is specific to the application. If EventDestroy is not called, the event is destroyed at the end of the application.
    AndroidWidget Android iPhone/iPadApple WatchJava The events are unique to the application that created them. They cannot be shared between several applications.
    shareUser
    (Default value)
    The event is shared between all the applications of the session of the user who runs the application.
    AndroidWidget Android iPhone/iPadApple WatchJava This constant is not available.
  • Mode for destroying the event:
    DestructionWithoutModificationBy default, an event is automatically modified during its destruction. If the event is created with the DestructionWithoutModification constant, it will not be modified when EventDestroy is called or when the application is closed and the event is automatically destroyed.
    AndroidWidget Android Java This constant is not available.
The information regarding the share mode and the destruction mode of the event can be combined.
Observaciones
WINDEVWEBDEV - Código ServidorReportes y ConsultasCódigo de Usuario (UMC)Ajax

Mode for sharing the events

In shareUser mode, the event is shared between all the applications of the session of the user who runs the application.
  • The event is created by the first application of the session of the user who calls EventCreate.
  • The following applications that call EventCreate connect to the existing semaphore.
  • The last application that is closed destroys the event.
  • A signal with the same name cannot be used by another user's session on the same machine: the system returns an access rights error.
In shareGlobal mode, the event is shared among all the applications found on the computer.
  • The event is created by the first application that calls EventCreate.
  • The following applications that call EventCreate connect to the existing semaphore.
  • The last application that is closed destroys the event.
Componente: wd300vm.dll
Versión mínima requerida
  • Versión 9
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