|
CMSDK 2.0.1
Cross-platform C++ base library and SDK for the Psyclone AIOS platform
|
Auto-reset notification event (condition variable style), optionally named for cross-process use. More...
#include <Utils.h>
Public Member Functions | |
| Event () | |
| Create an anonymous, process-local event. | |
| Event (const char *name) | |
| Create or open a named, cross-process event. | |
| ~Event () | |
| bool | waitNext () |
| Block until the next signal() occurs. | |
| bool | waitNext (uint32 timeout) |
| Wait for a signal with a timeout. | |
| bool | signal () |
| Wake all threads currently waiting on this event. | |
Protected Attributes | |
| char * | name |
| pthread_cond_t * | event |
| pthread_mutex_t * | mutex |
Auto-reset notification event (condition variable style), optionally named for cross-process use.
Unlike a semaphore, signals are not counted: a signal wakes waiters that are currently blocked in waitNext(); there is no memory of past signals.
| cmlabs::utils::Event::Event | ( | ) |
| cmlabs::utils::Event::Event | ( | const char * | name | ) |
Create or open a named, cross-process event.
| name | Global name. |
Definition at line 1512 of file Utils.cpp.
References cmlabs::utils::CreateSharedMemorySegment(), event, EVENTMEMSIZE, FALSE, MAXSHMEMNAMELEN, mutex, name, cmlabs::utils::OpenSharedMemorySegment(), TRUE, and WINSHMEMSPACE.
| cmlabs::utils::Event::~Event | ( | ) |
Definition at line 1553 of file Utils.cpp.
References cmlabs::utils::CloseSharedMemorySegment(), event, EVENTMEMSIZE, mutex, and name.
| bool cmlabs::utils::Event::signal | ( | ) |
Wake all threads currently waiting on this event.
Definition at line 1602 of file Utils.cpp.
Referenced by cmlabs::PsySpace::emitSignal().
| bool cmlabs::utils::Event::waitNext | ( | ) |
Block until the next signal() occurs.
Definition at line 1578 of file Utils.cpp.
Referenced by cmlabs::utils::WaitForNextEvent(), and cmlabs::PsySpace::waitForSignal().
| bool cmlabs::utils::Event::waitNext | ( | uint32 | timeout | ) |
Wait for a signal with a timeout.
| timeout | Max wait in milliseconds. |
Definition at line 1589 of file Utils.cpp.
References cmlabs::utils::CalcTimeout(), event, and mutex.
|
protected |
Definition at line 552 of file Utils.h.
Referenced by Event(), Event(), signal(), waitNext(), waitNext(), and ~Event().
|
protected |
Definition at line 553 of file Utils.h.
Referenced by Event(), Event(), signal(), waitNext(), waitNext(), and ~Event().
|
protected |