summaryrefslogtreecommitdiff
path: root/TAO/tao/Leader_Follower.i
diff options
context:
space:
mode:
authormk1 <mk1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2001-05-15 20:50:13 +0000
committermk1 <mk1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2001-05-15 20:50:13 +0000
commit61743c44fbc65877a1261d37125b08ee204f3c7b (patch)
tree2d887aa55716948603536831c8e817d99f62a451 /TAO/tao/Leader_Follower.i
parent79e1ec2b3da58893db285985109681257ee69ab8 (diff)
downloadATCD-61743c44fbc65877a1261d37125b08ee204f3c7b.tar.gz
ChangeLogTag: Tue May 15 15:48:00 2001 Michael Kircher <Michael.Kircher@mchp.siemens.de>
Diffstat (limited to 'TAO/tao/Leader_Follower.i')
-rw-r--r--TAO/tao/Leader_Follower.i29
1 files changed, 12 insertions, 17 deletions
diff --git a/TAO/tao/Leader_Follower.i b/TAO/tao/Leader_Follower.i
index 82496b9d253..ef81c8f664d 100644
--- a/TAO/tao/Leader_Follower.i
+++ b/TAO/tao/Leader_Follower.i
@@ -216,12 +216,13 @@ TAO_LF_Client_Leader_Thread_Helper::~TAO_LF_Client_Leader_Thread_Helper (void)
ACE_INLINE int
TAO_LF_Event_Loop_Thread_Helper::set_event_loop_thread (ACE_Time_Value *max_wait_time)
{
- ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->leader_follower_.lock (), -1);
+ // @@ Michael:
+ // Does this method need to be in that helper? Shouldn't it's contents be invoked
+ // directly?
+ // Does call_reset_ need to be proteced by the mutex?
- int result =
- this->leader_follower_.set_event_loop_thread (max_wait_time);
+ int result = this->lf_strategy_.set_event_loop_thread (max_wait_time, leader_follower_);
- // If successful, reset has to be called.
if (result == 0)
this->call_reset_ = 1;
@@ -229,24 +230,18 @@ TAO_LF_Event_Loop_Thread_Helper::set_event_loop_thread (ACE_Time_Value *max_wait
}
ACE_INLINE
-TAO_LF_Event_Loop_Thread_Helper::TAO_LF_Event_Loop_Thread_Helper (TAO_Leader_Follower &leader_follower)
+TAO_LF_Event_Loop_Thread_Helper::TAO_LF_Event_Loop_Thread_Helper (TAO_Leader_Follower &leader_follower,
+ TAO_LF_Strategy &lf_strategy)
: leader_follower_ (leader_follower),
+ lf_strategy_ (lf_strategy),
call_reset_ (0)
{
}
ACE_INLINE
TAO_LF_Event_Loop_Thread_Helper::~TAO_LF_Event_Loop_Thread_Helper (void)
-{
- ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->leader_follower_.lock ());
-
- if (this->call_reset_)
- this->leader_follower_.reset_event_loop_thread ();
-
- int result = this->leader_follower_.elect_new_leader ();
-
- if (result == -1)
- ACE_ERROR ((LM_ERROR,
- ACE_TEXT ("TAO (%P|%t) Failed to wake up ")
- ACE_TEXT ("a follower thread\n")));
+{
+ this->lf_strategy_.reset_event_loop_thread_and_elect_new_leader (this->call_reset_,
+ this->leader_follower_);
}
+