DWFCore::DWFSignal Class Reference
[Platform-specific Class and Function Declarations]

#include "dwfcore/win32/Signal.h"

Inheritance diagram for DWFCore::DWFSignal:

Inheritance graph
[legend]
Collaboration diagram for DWFCore::DWFSignal:

Collaboration graph
[legend]
List of all members.

Detailed Description

An inter-thread notification synchronization object for Microsoft Windows platforms.

Since:
1.0.1
This implementation does not provide any sort of manual state control or reset. Any number of threads my block in wait(), they will all be release immediately by raise(). Any subsequent wait() call will block again until the signal is re-raised.

Example:

                        (thread 1)                              (thread 2)
                        for (i = 0; i < 10; i++)
                        {
                            cout << "waiting..." << endl;
                            rSignal.wait();                     cout << "raising signal..." << endl;
                            cout << "signalled!" << endl;       oSignal.raise();
                        }                                       cout << "raised." << endl;
                        cout << "thread 1 done." << endl;       cout << "thread 2 done." << endl;
   
                        Output:
                        
                            waiting...
                            raising signal...
                            signalled!
                            waiting...              <== thread 1 blocked again
                            raised.
                            thread 2 done.

Definition at line 85 of file win32/Signal.h.

Public Member Functions

_DWFCORE_API DWFSignal () throw ()
virtual _DWFCORE_API ~DWFSignal () throw ()
_DWFCORE_API void init () throw ( DWFException )
_DWFCORE_API void destroy () throw ( DWFException )
_DWFCORE_API bool wait (unsigned long nMilliseconds=0) throw ( DWFException )
_DWFCORE_API void raise () throw ( DWFException )


Constructor & Destructor Documentation

_DWFCORE_API DWFCore::DWFSignal::DWFSignal  )  throw ()
 

Constructor

Exceptions:
None 

virtual _DWFCORE_API DWFCore::DWFSignal::~DWFSignal  )  throw () [virtual]
 

Destructor

Exceptions:
None 


Member Function Documentation

_DWFCORE_API void DWFCore::DWFSignal::destroy  )  throw ( DWFException )
 

Destroy the signal. A client must always invoke this method after using this object.

Exceptions:
DWFException 

_DWFCORE_API void DWFCore::DWFSignal::init  )  throw ( DWFException )
 

Initialize the signal. A client must always invoke this method before using this object.

Exceptions:
DWFException 

_DWFCORE_API void DWFCore::DWFSignal::raise  )  throw ( DWFException )
 

Raises the signal releasing any threads blocking on wait().

Exceptions:
DWFException 

_DWFCORE_API bool DWFCore::DWFSignal::wait unsigned long  nMilliseconds = 0  )  throw ( DWFException )
 

Blocking call to wait for the signal to be raised. All blocked threads will be released on raise().

Parameters:
nMilliseconds The amount of time to wait for the signal to be raised. Specify 0 milliseconds to wait indefinitely.
Returns:
true if the signal was raised, false if the wait timed out.
Exceptions:
DWFException 


The documentation for this class was generated from the following file:
Generated on Tue Jan 6 22:39:44 2009 for Autodesk DWF Core Library by  doxygen 1.4.5