#include <Condition.h>
Collaboration diagram for TAO_Condition< MUTEX >:

Public Types | |
| typedef MUTEX | LOCK |
| Useful typedef. | |
Public Member Functions | |
| TAO_Condition (MUTEX &m) | |
| Initialize the condition variable. | |
| TAO_Condition (void) | |
| ~TAO_Condition (void) | |
| Implicitly destroy the condition variable. | |
| int | wait (const ACE_Time_Value *abstime) |
| int | wait (void) |
| Block on condition. | |
| int | wait (MUTEX &mutex, const ACE_Time_Value *abstime=0) |
| int | signal (void) |
| Signal one waiting thread. | |
| int | broadcast (void) |
| Signal *all* waiting threads. | |
| int | remove (void) |
| Explicitly destroy the condition variable. | |
| MUTEX * | mutex (void) |
| Returns a reference to the underlying mutex_;. | |
Private Member Functions | |
| void | operator= (const TAO_Condition< MUTEX > &) |
| TAO_Condition (const TAO_Condition< MUTEX > &) | |
Private Attributes | |
| MUTEX * | mutex_ |
| Reference to mutex lock. | |
| int | delete_lock_ |
| A flag to indicate whether the lock needs to be deleted. | |
| TAO_SYNCH_CONDITION * | cond_ |
| Condition variable. | |
This class differs from ACE_Condition in that it uses a TAO_SYNCH_CONDITION instead of ACE_cond_t under the hood to provide blocking.
Definition at line 43 of file Condition.h.
|
|||||
|
Useful typedef.
Definition at line 48 of file Condition.h. |
|
||||||||||
|
Initialize the condition variable.
Definition at line 16 of file Condition.cpp. References ACE_NEW, and TAO_SYNCH_CONDITION.
00018 : mutex_ (&m), 00019 delete_lock_ (0), 00020 cond_ (0) 00021 { 00022 // @@todo: Need to add the allocatore here.. 00023 ACE_NEW (this->cond_, 00024 TAO_SYNCH_CONDITION (*this->mutex_)); 00025 } |
|
||||||||||
|
A default constructor. Since no lock is provided by the user, one will be created internally. Definition at line 28 of file Condition.cpp. References ACE_NEW, and TAO_SYNCH_CONDITION.
00029 : mutex_ (0), 00030 delete_lock_ (0), 00031 cond_ (0) 00032 00033 { 00034 // @@todo: Need to add the allocatore here.. 00035 00036 ACE_NEW (this->mutex_, 00037 MUTEX); 00038 00039 this->delete_lock_ = 1; 00040 00041 ACE_NEW (this->cond_, 00042 TAO_SYNCH_CONDITION (*this->mutex_)); 00043 } |
|
||||||||||
|
Implicitly destroy the condition variable.
Definition at line 47 of file Condition.cpp. References ACE_ERROR, ACE_TEXT, LM_ERROR, and TAO_Condition< MUTEX >::remove().
00048 {
00049 if (this->remove () == -1)
00050 ACE_ERROR ((LM_ERROR,
00051 ACE_TEXT ("%p\n"),
00052 ACE_TEXT ("TAO_Condition::~TAO_Condition")));
00053
00054 delete this->cond_;
00055
00056 if (this->delete_lock_)
00057 delete this->mutex_;
00058 }
|
|
||||||||||
|
|
|
||||||||||
|
Signal *all* waiting threads.
Definition at line 50 of file Condition.inl.
00051 {
00052 return this->cond_->broadcast ();
00053 }
|
|
||||||||||
|
Returns a reference to the underlying mutex_;.
Definition at line 38 of file Condition.inl.
00039 {
00040 return this->mutex_;
00041 }
|
|
||||||||||
|
|
|
||||||||||
|
Explicitly destroy the condition variable.
Definition at line 32 of file Condition.inl. Referenced by TAO_Condition< MUTEX >::~TAO_Condition().
00033 {
00034 return this->cond_->remove ();
00035 }
|
|
||||||||||
|
Signal one waiting thread.
Definition at line 44 of file Condition.inl.
00045 {
00046 return this->cond_->signal ();
00047 }
|
|
||||||||||||||||
|
Block on condition or until absolute time-of-day has passed. If abstime == 0 use "blocking" wait() semantics on the passed as a parameter (this is useful if you need to store the in shared memory). Else, if != 0 and the call times out before the condition is signaled returns -1 and sets errno to ETIME. Definition at line 14 of file Condition.inl.
00016 {
00017 return this->cond_->wait (mutex,
00018 abstime);
00019 }
|
|
||||||||||
|
Block on condition.
Definition at line 8 of file Condition.inl. Referenced by TAO_Condition< MUTEX >::wait().
00009 {
00010 return this->cond_->wait ();
00011 }
|
|
||||||||||
|
Block on condition, or until absolute time-of-day has passed. If abstime == 0 use "blocking" semantics. Else, if != 0 and the call times out before the condition is signaled returns -1 and sets errno to ETIME. Definition at line 26 of file Condition.inl. References TAO_Condition< MUTEX >::wait().
00027 {
00028 return this->wait (*this->mutex_, abstime);
00029 }
|
|
|||||
|
Condition variable.
Definition at line 105 of file Condition.h. |
|
|||||
|
A flag to indicate whether the lock needs to be deleted.
Definition at line 102 of file Condition.h. |
|
|||||
|
Reference to mutex lock.
Definition at line 99 of file Condition.h. |
1.3.6