The CAMEvent class is an event object that can be set and waited on to provide interthread synchronization. This is currently implemented by using the Microsoft® Win32® Event application programming interfaces (APIs).
Events can be created as manual-reset or automatic-reset, and will always be created as not set (nonsignaled state). They can also be cast to handles so as to be passed to the Win32 WaitForMultipleObjects function.
Protected Data Members
Name | Description |
m_hEvent | Microsoft Win32 event handle. |
Member Functions
Name | Description |
CAMEvent | Constructs a CAMEvent object. |
Check | Returns TRUE if the event is currently set, but does not block. |
Reset | Forces the event into a nonsignaled state. |
Set | Puts the event into a signaled state. |
Wait | Blocks until the event is signaled, or until an optional time-out occurs. |
operator HANDLE | Gets the HANDLE object. |
Constructs a CAMEvent object.
CAMEvent(
BOOL fManualReset = FALSE
);
No return value.
Returns TRUE if the event is currently set, but does not block.
BOOL Check(void);
For events that are not manual-reset events, this member function causes the event to enter a nonsignaled state.
Forces the event into a nonsignaled state.
void Reset(void);
No return value.
Puts the event into a signaled state.
void Set(void);
No return value.
If the event is not a manual-reset event and there is at least one thread blocked on this event, the thread is released and the event remains in a nonsignaled state. If the event is not a manual-reset event and no threads are blocked on the event, it is set to a signaled state.
If the event is not a manual-reset event, it is set to a signaled state and all the threads blocked on this event are released.
Blocks until the event is signaled, or until the indicated time-out occurs.
BOOL Wait(
DWORD dwTimeout
);
Returns TRUE if the event becomes signaled; otherwise, returns FALSE.
For events that are not manual-reset events, the action completing the CAMEvent::Wait member function causes the event to enter a nonsignaled state until the CAMEvent::Set member function is called.
Gets the HANDLE object associated with this CAMEvent object.
operator HANDLE () const;
Returns the Microsoft Win32 event HANDLE.
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.