TC::MT::Event Class Reference
[Multithreading]

An object of class Event represents a synchronization object that allows one thread to notify another that an event has occurred. More...

#include <TCMTEvent.h>

Inheritance diagram for TC::MT::Event:

Inheritance graph
[legend]
Collaboration diagram for TC::MT::Event:

Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual bool Wait ()=0
 Wait for ever until the event was set or an error happens.
virtual bool Wait (uint32 millisecs)=0
 Wait for specified time or until the event was set or an error happens.
virtual bool Try ()=0
 Try if the event is already set.
virtual bool Set ()=0
 Set the event.
virtual bool Reset ()=0
 Reset the event.
virtual ~Event ()


Detailed Description

An object of class Event represents a synchronization object that allows one thread to notify another that an event has occurred.

Events are useful when a thread needs to know when to perform its task or a task has finished

Event objects have two types: manual and automatic. A manual Event object stays in the state set by Set or Reset until the other function is called. An automatic Event object automatically returns to a nonsignaled (unavailable) state after at least one thread is released.

To use a Event object, construct the Event object when it is needed. Call Set to signal (make available) the event object. In the other thread reat it out with Wait or TryWait.

Definition at line 72 of file TCMTEvent.h.


Constructor & Destructor Documentation

virtual TC::MT::Event::~Event (  )  [inline, virtual]

Definition at line 102 of file TCMTEvent.h.


Member Function Documentation

virtual bool TC::MT::Event::Wait (  )  [pure virtual]

Wait for ever until the event was set or an error happens.

Returns:
true if the event was set else error

virtual bool TC::MT::Event::Wait ( uint32  millisecs  )  [pure virtual]

Wait for specified time or until the event was set or an error happens.

Parameters:
millisecs Time in milliseconds to wait
Returns:
true if the event was set else timeout or error

virtual bool TC::MT::Event::Try (  )  [pure virtual]

Try if the event is already set.

Returns:
true if the event was set else error

virtual bool TC::MT::Event::Set (  )  [pure virtual]

Set the event.

Returns:
if successful set

virtual bool TC::MT::Event::Reset (  )  [pure virtual]

Reset the event.

Returns:
if successful reset


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

Copyright (c) Thomas Goessler 2003 - 2008