summaryrefslogtreecommitdiff
path: root/ace/Future.cpp
diff options
context:
space:
mode:
authorschmidt <douglascraigschmidt@users.noreply.github.com>2003-06-17 17:27:01 +0000
committerschmidt <douglascraigschmidt@users.noreply.github.com>2003-06-17 17:27:01 +0000
commite03694164f05cff200ef50c7417ece2076a23b48 (patch)
treee91e270ff75f9c18d9f154a987feaf1f4a6ed0aa /ace/Future.cpp
parent0269d1bd791ce7e506d400021dbdb10bf2d97bfe (diff)
downloadATCD-e03694164f05cff200ef50c7417ece2076a23b48.tar.gz
ChangeLogTag:Tue Jun 17 11:47:52 2003 Douglas C. Schmidt <schmidt@macarena.cs.wustl.edu>
Diffstat (limited to 'ace/Future.cpp')
-rw-r--r--ace/Future.cpp25
1 files changed, 11 insertions, 14 deletions
diff --git a/ace/Future.cpp b/ace/Future.cpp
index e50418cc804..71575687b7a 100644
--- a/ace/Future.cpp
+++ b/ace/Future.cpp
@@ -91,7 +91,7 @@ ACE_Future_Rep<T>::attach (ACE_Future_Rep<T>*& rep)
{
ACE_ASSERT (rep != 0);
// Use value_ready_mutex_ for both condition and ref count management
- ACE_MT (ACE_Guard<ACE_Thread_Mutex> r_mon (rep->value_ready_mutex_));
+ ACE_MT (ACE_Guard<ACE_Recursive_Thread_Mutex> r_mon (rep->value_ready_mutex_));
++rep->ref_count_;
return rep;
}
@@ -101,7 +101,7 @@ ACE_Future_Rep<T>::detach (ACE_Future_Rep<T>*& rep)
{
ACE_ASSERT (rep != 0);
// Use value_ready_mutex_ for both condition and ref count management
- ACE_MT (ACE_GUARD (ACE_Thread_Mutex, r_mon, rep->value_ready_mutex_));
+ ACE_MT (ACE_GUARD (ACE_Recursive_Thread_Mutex, r_mon, rep->value_ready_mutex_));
if (rep->ref_count_-- == 0)
{
@@ -119,7 +119,7 @@ ACE_Future_Rep<T>::assign (ACE_Future_Rep<T>*& rep, ACE_Future_Rep<T>* new_rep)
ACE_ASSERT (rep != 0);
ACE_ASSERT (new_rep != 0);
// Use value_ready_mutex_ for both condition and ref count management
- ACE_MT (ACE_GUARD (ACE_Thread_Mutex, r_mon, rep->value_ready_mutex_));
+ ACE_MT (ACE_GUARD (ACE_Recursive_Thread_Mutex, r_mon, rep->value_ready_mutex_));
ACE_Future_Rep<T>* old = rep;
rep = new_rep;
@@ -162,7 +162,7 @@ ACE_Future_Rep<T>::set (const T &r,
// If the value is already produced, ignore it...
if (this->value_ == 0)
{
- ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex,
+ ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex,
ace_mon,
this->value_ready_mutex_,
-1));
@@ -203,15 +203,15 @@ ACE_Future_Rep<T>::get (T &value,
// If the value is already produced, return it.
if (this->value_ == 0)
{
- ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon,
- ACE_const_cast (ACE_Thread_Mutex &, this->value_ready_mutex_),
+ ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon,
+ ACE_const_cast (ACE_Recursive_Thread_Mutex &, this->value_ready_mutex_),
-1));
// If the value is not yet defined we must block until the
// producer writes to it.
while (this->value_ == 0)
// Perform a timed wait.
- if ((ACE_const_cast (ACE_Condition_Thread_Mutex &, this->value_ready_)).wait (tv) == -1)
+ if ((ACE_const_cast (ACE_Condition_Recursive_Thread_Mutex &, this->value_ready_)).wait (tv) == -1)
return -1;
// Destructor releases the lock.
@@ -225,7 +225,7 @@ template <class T> int
ACE_Future_Rep<T>::attach (ACE_Future_Observer<T> *observer,
ACE_Future<T> &caller)
{
- ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->value_ready_mutex_, -1));
+ ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, this->value_ready_mutex_, -1));
// Otherwise, create a new result value. Note the use of the
// Double-checked locking pattern to avoid corrupting the list.
@@ -244,7 +244,7 @@ ACE_Future_Rep<T>::attach (ACE_Future_Observer<T> *observer,
template <class T> int
ACE_Future_Rep<T>::detach (ACE_Future_Observer<T> *observer)
{
- ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->value_ready_mutex_, -1));
+ ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, this->value_ready_mutex_, -1));
// Remove all occurrences of the specified observer from this
// objects hash map.
@@ -258,7 +258,7 @@ ACE_Future_Rep<T>::operator T ()
if (this->value_ == 0)
{
// Constructor of ace_mon acquires the mutex.
- ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->value_ready_mutex_, 0));
+ ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, this->value_ready_mutex_, 0));
// If the value is not yet defined we must block until the
// producer writes to it.
@@ -294,10 +294,7 @@ template <class T>
ACE_Future<T>::ACE_Future (const T &r)
: future_rep_ (FUTURE_REP::create ())
{
- ACE_DEBUG ((LM_DEBUG,
- ACE_LIB_TEXT (" (%t) funny constructor\n")));
- this->future_rep_->set (r,
- *this);
+ this->future_rep_->set (r, *this);
}
template <class T>