00001 // $Id: Condition.cpp 79169 2007-08-02 08:41:23Z johnnyw $ 00002 00003 #ifndef TAO_CONDITION_CPP 00004 #define TAO_CONDITION_CPP 00005 #include "tao/Condition.h" 00006 #include "ace/Log_Msg.h" 00007 00008 #if !defined (__ACE_INLINE__) 00009 # include "tao/Condition.inl" 00010 #endif /* __ACE_INLINE__ */ 00011 00012 00013 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00014 00015 template <class MUTEX> 00016 TAO_Condition<MUTEX>::TAO_Condition (MUTEX &m) 00017 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 } 00026 00027 template <class MUTEX> 00028 TAO_Condition<MUTEX>::TAO_Condition (void) 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 } 00044 00045 00046 template <class MUTEX> 00047 TAO_Condition<MUTEX>::~TAO_Condition (void) 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 } 00059 00060 TAO_END_VERSIONED_NAMESPACE_DECL 00061 00062 #endif /* TAO_CONDITION_CPP */