Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / TAO / tao / LF_Strategy_Complete.cpp
blob1b7d4e4c60ca96161f6055f065ef4ba4ccf8d515
1 #include "tao/LF_Strategy_Complete.h"
2 #include "tao/LF_Follower.h"
3 #include "tao/Leader_Follower.h"
4 #include "ace/Guard_T.h"
5 #include "tao/debug.h"
7 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
9 TAO_LF_Strategy_Complete::~TAO_LF_Strategy_Complete ()
13 void
14 TAO_LF_Strategy_Complete::set_upcall_thread (TAO_Leader_Follower &lf)
16 lf.set_upcall_thread ();
19 int
20 TAO_LF_Strategy_Complete::set_event_loop_thread (ACE_Time_Value *tv,
21 TAO_Leader_Follower &lf)
23 ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, lf.lock (), -1);
25 return lf.set_event_loop_thread (tv);
28 void
29 TAO_LF_Strategy_Complete::reset_event_loop_thread (int call_reset,
30 TAO_Leader_Follower &lf)
32 ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, lf.lock ());
34 if (call_reset)
35 lf.reset_event_loop_thread ();
37 int const result = lf.elect_new_leader ();
39 if (result == -1)
40 TAOLIB_ERROR ((LM_ERROR,
41 ACE_TEXT ("TAO (%P|%t) - Failed to wake up ")
42 ACE_TEXT ("a follower thread\n")));
45 TAO_END_VERSIONED_NAMESPACE_DECL