00001 // -*- C++ -*- 00002 // 00003 // $Id: CSD_TP_Synch_Helper.inl 69182 2005-11-03 17:38:46Z ossama $ 00004 00005 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00006 00007 ACE_INLINE 00008 TAO::CSD::TP_Synch_Helper::TP_Synch_Helper() 00009 : state_(PENDING), 00010 condition_(this->lock_) 00011 { 00012 } 00013 00014 00015 ACE_INLINE 00016 TAO::CSD::TP_Synch_Helper::~TP_Synch_Helper() 00017 { 00018 } 00019 00020 00021 ACE_INLINE 00022 bool 00023 TAO::CSD::TP_Synch_Helper::wait_while_pending() 00024 { 00025 GuardType guard(this->lock_); 00026 00027 while (this->state_ == PENDING) 00028 { 00029 this->condition_.wait(); 00030 } 00031 00032 return (this->state_ == DISPATCHED); 00033 } 00034 00035 00036 ACE_INLINE 00037 void 00038 TAO::CSD::TP_Synch_Helper::dispatched() 00039 { 00040 GuardType guard(this->lock_); 00041 this->state_ = DISPATCHED; 00042 this->condition_.signal(); 00043 } 00044 00045 00046 ACE_INLINE 00047 void 00048 TAO::CSD::TP_Synch_Helper::cancelled() 00049 { 00050 GuardType guard(this->lock_); 00051 this->state_ = CANCELLED; 00052 this->condition_.signal(); 00053 } 00054 00055 TAO_END_VERSIONED_NAMESPACE_DECL