MLIB
|
Base class for all named synchronization objects. More...
#include <syncbase.h>
Public Member Functions | |
syncbase () | |
Default constructor. | |
syncbase (const syncbase &e) | |
Copy constructor. | |
syncbase (syncbase &&e) noexcept | |
Move constructor. | |
virtual | ~syncbase () |
Destructor. | |
syncbase & | operator= (const syncbase &rhs) |
Assignment operator. | |
syncbase & | operator= (syncbase &&rhs) noexcept |
Move assignment operator. | |
int | operator== (const syncbase &rhs) const |
Equality operator. | |
virtual void | wait () |
Wait for object to become signaled. | |
virtual DWORD | wait (DWORD limit_msec) |
Wait a number of milliseconds for the object to become signaled. | |
virtual DWORD | wait (std::chrono::milliseconds limit) |
Wait a number of milliseconds for the object to become signaled. | |
virtual DWORD | wait_alertable (DWORD limit_msec=INFINITE) |
virtual DWORD | wait_msg (DWORD limit_msec=INFINITE, DWORD mask=QS_ALLINPUT) |
Wait for object to become signaled or a message to be queued. | |
operator bool () | |
Check if object is signaled. | |
virtual bool | is_signaled () |
Try to wait on the object. | |
HANDLE | handle () const |
Return OS handle of this object. | |
virtual const std::string & | name () const |
Return object's name. | |
Protected Member Functions | |
syncbase (const std::string &name) | |
Protected constructor. | |
void | set_handle (HANDLE h) |
Change object's handle. Closes the previous one. | |
virtual void | name (const std::string &nam) |
Change object's name. | |
Base class for all named synchronization objects.
The Windows handle has an instance counter so copying and assignment are safe and rather cheap (doesn't call DuplicateHandle).
The virtual bool conversion operator allows testing the signaled state of the object (it is true if object is signaled).
|
inlinevirtual |
Try to wait on the object.
Returns true if the object was in a signaled state.
Reimplemented in mlib::auto_event.
|
inlinevirtual |
Return object's name.
Reimplemented in mlib::thread.
|
inlineprotectedvirtual |
Change object's name.
Reimplemented in mlib::thread.
|
inlinevirtual |
Wait a number of milliseconds for the object to become signaled.
limit_msec | maximum wait time in milliseconds |
WAIT_OBJECT0
if object becomes signaled WAIT_TIMEOUT
if timeout has expired Reimplemented in mlib::thread.
|
inlinevirtual |
Wait a number of milliseconds for the object to become signaled.
limit | maximum wait time |
WAIT_OBJECT0
if object becomes signaled WAIT_TIMEOUT
if timeout has expired
|
inlinevirtual |
Wait for object to become signaled or an APC or IO completion routine to occur
Reimplemented in mlib::thread.
|
inlinevirtual |
Wait for object to become signaled or a message to be queued.
limit_msec | time-out interval, in milliseconds |
mask | input message types |
WAIT_OBJECT_0
thread finished WAIT_TIMEOUT
time-out interval expired WAIT_OBJECT_0+1
Input message received.The mask
parameter can be any combination of flags described for the GetQueueStatus function.
Reimplemented in mlib::thread.