Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tao / Condition.cpp
blob7a77ef1f4cc356ea81710fac2cae4f4d085bda0f
1 #ifndef TAO_CONDITION_CPP
2 #define TAO_CONDITION_CPP
3 #include "tao/Condition.h"
4 #include "tao/debug.h"
6 #if !defined (__ACE_INLINE__)
7 # include "tao/Condition.inl"
8 #endif /* __ACE_INLINE__ */
10 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
12 template <class MUTEX>
13 TAO_Condition<MUTEX>::TAO_Condition (MUTEX &m)
14 : mutex_ (&m),
15 delete_lock_ (false),
16 cond_ (nullptr)
18 // @todo: Need to add the allocatore here..
19 ACE_NEW (this->cond_,
20 TAO_SYNCH_CONDITION (*this->mutex_));
23 template <class MUTEX>
24 TAO_Condition<MUTEX>::TAO_Condition ()
25 : mutex_ (nullptr),
26 delete_lock_ (false),
27 cond_ (nullptr)
30 // @todo: Need to add the allocatore here..
31 ACE_NEW (this->mutex_,
32 MUTEX);
34 this->delete_lock_ = true;
36 ACE_NEW (this->cond_,
37 TAO_SYNCH_CONDITION (*this->mutex_));
41 template <class MUTEX>
42 TAO_Condition<MUTEX>::~TAO_Condition ()
44 if (this->remove () == -1)
45 TAOLIB_ERROR ((LM_ERROR,
46 ACE_TEXT ("%p\n"),
47 ACE_TEXT ("TAO_Condition::~TAO_Condition")));
49 delete this->cond_;
51 if (this->delete_lock_)
52 delete this->mutex_;
55 TAO_END_VERSIONED_NAMESPACE_DECL
57 #endif /* TAO_CONDITION_CPP */