STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
Concurrency::event Class Reference

A manual reset event which is explicitly aware of the Concurrency Runtime. More...

#include <concrt.h>

Public Member Functions

_CRTIMP event ()
 Constructs a new event. More...
 
_CRTIMP ~event ()
 Destroys an event. More...
 
_CRTIMP size_t wait (unsigned int _Timeout=COOPERATIVE_TIMEOUT_INFINITE)
 Waits for the event to become signaled. More...
 
_CRTIMP void set ()
 Signals the event. More...
 
_CRTIMP void reset ()
 Resets the event to a non-signaled state. More...
 

Static Public Member Functions

static _CRTIMP size_t __cdecl wait_for_multiple (_In_reads_(_Count) event **_PPEvents, size_t _Count, bool _FWaitAll, unsigned int _Timeout=COOPERATIVE_TIMEOUT_INFINITE)
 Waits for multiple events to become signaled. More...
 

Static Public Attributes

static const unsigned int timeout_infinite = COOPERATIVE_TIMEOUT_INFINITE
 Value indicating that a wait should never time out. More...
 

Private Member Functions

 event (const event &_Event)
 
eventoperator= (const event &_Event)
 

Private Attributes

void *volatile _M_pWaitChain
 
void_M_pResetChain
 
Concurrency::critical_section _M_lock
 

Detailed Description

A manual reset event which is explicitly aware of the Concurrency Runtime.

For more information, see Synchronization Data Structures.

Constructor & Destructor Documentation

_CRTIMP Concurrency::event::event ( )

Constructs a new event.

_CRTIMP Concurrency::event::~event ( )

Destroys an event.

It is expected that there are no threads waiting on the event when the destructor runs. Allowing the event to destruct with threads still waiting on it results in undefined behavior.

Concurrency::event::event ( const event _Event)
private

Member Function Documentation

event& Concurrency::event::operator= ( const event _Event)
private
_CRTIMP void Concurrency::event::reset ( )

Resets the event to a non-signaled state.

See also
event::set Method, event::wait Method
_CRTIMP void Concurrency::event::set ( )

Signals the event.

Signaling the event can cause an arbitrary number of contexts waiting on the event to become runnable.

See also
event::wait Method, event::reset Method
_CRTIMP size_t Concurrency::event::wait ( unsigned int  _Timeout = COOPERATIVE_TIMEOUT_INFINITE)

Waits for the event to become signaled.

Parameters
_TimeoutIndicates the number of milliseconds before the wait times out. The value COOPERATIVE_TIMEOUT_INFINITE signifies that there is no timeout.
Returns
If the wait was satisfied, the value 0 is returned; otherwise, the value COOPERATIVE_WAIT_TIMEOUT to indicate that the wait timed out without the event becoming signaled.
See also
event::set Method, COOPERATIVE_TIMEOUT_INFINITE Constant

COOPERATIVE_TIMEOUT_INFINITE

See also
COOPERATIVE_WAIT_TIMEOUT Constant

COOPERATIVE_WAIT_TIMEOUT

static _CRTIMP size_t __cdecl Concurrency::event::wait_for_multiple ( _In_reads_(_Count) event **  _PPEvents,
size_t  _Count,
bool  _FWaitAll,
unsigned int  _Timeout = COOPERATIVE_TIMEOUT_INFINITE 
)
static

Waits for multiple events to become signaled.

Parameters
_PPEventsAn array of events to wait on. The number of events within the array is indicated by the _Count parameter.
_CountThe count of events within the array supplied in the _PPEvents parameter.
_FWaitAllIf set to the value true, the parameter specifies that all events within the array supplied in the _PPEvents parameter must become signaled in order to satisfy the wait. If set to the value false, it specifies that any event within the array supplied in the _PPEvents parameter becoming signaled will satisfy the wait.
_TimeoutIndicates the number of milliseconds before the wait times out. The value COOPERATIVE_TIMEOUT_INFINITE signifies that there is no timeout.
Returns
If the wait was satisfied, the index within the array supplied in the _PPEvents parameter which satisfied the wait condition; otherwise, the value COOPERATIVE_WAIT_TIMEOUT to indicate that the wait timed out without the condition being satisfied.

If the parameter _FWaitAll is set to the value true to indicate that all events must become signaled to satisfy the wait, the index returned by the function carries no special significance other than the fact that it is not the value COOPERATIVE_WAIT_TIMEOUT.

See also
event::wait Method, COOPERATIVE_TIMEOUT_INFINITE Constant

COOPERATIVE_TIMEOUT_INFINITE

See also
COOPERATIVE_WAIT_TIMEOUT Constant

COOPERATIVE_WAIT_TIMEOUT

Member Data Documentation

Concurrency::critical_section Concurrency::event::_M_lock
private
void* Concurrency::event::_M_pResetChain
private
void* volatile Concurrency::event::_M_pWaitChain
private
const unsigned int Concurrency::event::timeout_infinite = COOPERATIVE_TIMEOUT_INFINITE
static

Value indicating that a wait should never time out.


The documentation for this class was generated from the following file: