From e03694164f05cff200ef50c7417ece2076a23b48 Mon Sep 17 00:00:00 2001 From: schmidt Date: Tue, 17 Jun 2003 17:27:01 +0000 Subject: ChangeLogTag:Tue Jun 17 11:47:52 2003 Douglas C. Schmidt --- ace/Future.cpp | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) (limited to 'ace/Future.cpp') 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::attach (ACE_Future_Rep*& rep) { ACE_ASSERT (rep != 0); // Use value_ready_mutex_ for both condition and ref count management - ACE_MT (ACE_Guard r_mon (rep->value_ready_mutex_)); + ACE_MT (ACE_Guard r_mon (rep->value_ready_mutex_)); ++rep->ref_count_; return rep; } @@ -101,7 +101,7 @@ ACE_Future_Rep::detach (ACE_Future_Rep*& 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::assign (ACE_Future_Rep*& rep, ACE_Future_Rep* 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* old = rep; rep = new_rep; @@ -162,7 +162,7 @@ ACE_Future_Rep::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::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 int ACE_Future_Rep::attach (ACE_Future_Observer *observer, ACE_Future &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::attach (ACE_Future_Observer *observer, template int ACE_Future_Rep::detach (ACE_Future_Observer *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::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 ACE_Future::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 -- cgit v1.2.1