diff options
Diffstat (limited to 'TAO/tao/CSD_ThreadPool/CSD_TP_Synch_Helper.inl')
-rw-r--r-- | TAO/tao/CSD_ThreadPool/CSD_TP_Synch_Helper.inl | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/TAO/tao/CSD_ThreadPool/CSD_TP_Synch_Helper.inl b/TAO/tao/CSD_ThreadPool/CSD_TP_Synch_Helper.inl new file mode 100644 index 00000000000..f4c5a1380c1 --- /dev/null +++ b/TAO/tao/CSD_ThreadPool/CSD_TP_Synch_Helper.inl @@ -0,0 +1,55 @@ +// -*- C++ -*- +// +// $Id$ + +TAO_BEGIN_VERSIONED_NAMESPACE_DECL + +ACE_INLINE +TAO::CSD::TP_Synch_Helper::TP_Synch_Helper() + : state_(PENDING), + condition_(this->lock_) +{ +} + + +ACE_INLINE +TAO::CSD::TP_Synch_Helper::~TP_Synch_Helper() +{ +} + + +ACE_INLINE +bool +TAO::CSD::TP_Synch_Helper::wait_while_pending() +{ + GuardType guard(this->lock_); + + while (this->state_ == PENDING) + { + this->condition_.wait(); + } + + return (this->state_ == DISPATCHED); +} + + +ACE_INLINE +void +TAO::CSD::TP_Synch_Helper::dispatched() +{ + GuardType guard(this->lock_); + this->state_ = DISPATCHED; + this->condition_.signal(); +} + + +ACE_INLINE +void +TAO::CSD::TP_Synch_Helper::cancelled() +{ + GuardType guard(this->lock_); + this->state_ = CANCELLED; + this->condition_.signal(); +} + +TAO_END_VERSIONED_NAMESPACE_DECL |