diff options
author | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-02-03 22:29:08 +0000 |
---|---|---|
committer | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-02-03 22:29:08 +0000 |
commit | 70455b4c56eea99e06171dc595f564bf081ca7c4 (patch) | |
tree | 907c4acc1ac81ccdc5236de413a663056865197d /TAO/tao/Leader_Follower.i | |
parent | bc732b27cac066ff164d8031e91a4aabbb5557bc (diff) | |
download | ATCD-70455b4c56eea99e06171dc595f564bf081ca7c4.tar.gz |
ChangeLogTag: Thu Feb 03 16:12:01 2000 Irfan Pyarali <irfan@cs.wustl.edu>
Diffstat (limited to 'TAO/tao/Leader_Follower.i')
-rw-r--r-- | TAO/tao/Leader_Follower.i | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/TAO/tao/Leader_Follower.i b/TAO/tao/Leader_Follower.i index 9fbc3d2e0ae..e62adbb5d38 100644 --- a/TAO/tao/Leader_Follower.i +++ b/TAO/tao/Leader_Follower.i @@ -212,19 +212,6 @@ TAO_LF_Leader_Thread_Helper::~TAO_LF_Leader_Thread_Helper (void) } ACE_INLINE int -TAO_LF_Server_Thread_Helper::reset_server_thread (void) -{ - // Reset has been called explicitly, no need to auto reset. - this->auto_reset_ = 0; - - ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->leader_follower_.lock (), -1); - - this->leader_follower_.reset_server_thread (); - - return this->leader_follower_.elect_new_leader (); -} - -ACE_INLINE int TAO_LF_Server_Thread_Helper::set_server_thread (ACE_Time_Value *max_wait_time) { ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->leader_follower_.lock (), -1); @@ -234,7 +221,7 @@ TAO_LF_Server_Thread_Helper::set_server_thread (ACE_Time_Value *max_wait_time) // If successful, reset has to be called. if (result == 0) - this->auto_reset_ = 1; + this->call_reset_ = 1; return result; } @@ -242,13 +229,22 @@ TAO_LF_Server_Thread_Helper::set_server_thread (ACE_Time_Value *max_wait_time) ACE_INLINE TAO_LF_Server_Thread_Helper::TAO_LF_Server_Thread_Helper (TAO_Leader_Follower &leader_follower) : leader_follower_ (leader_follower), - auto_reset_ (0) + call_reset_ (0) { } ACE_INLINE TAO_LF_Server_Thread_Helper::~TAO_LF_Server_Thread_Helper (void) { - if (this->auto_reset_) - this->reset_server_thread (); + ACE_GUARD (ACE_SYNCH_MUTEX, ace_mon, this->leader_follower_.lock ()); + + if (this->call_reset_) + this->leader_follower_.reset_server_thread (); + + int result = this->leader_follower_.elect_new_leader (); + + if (result == -1) + ACE_ERROR ((LM_ERROR, + ASYS_TEXT ("TAO (%P|%t) Failed to wake up ") + ASYS_TEXT ("a follower thread\n"))); } |