LF_Strategy_Complete.cpp

Go to the documentation of this file.
00001 // LF_Strategy_Complete.cpp,v 1.6 2006/04/19 09:01:20 jwillemsen Exp
00002 
00003 #include "tao/LF_Strategy_Complete.h"
00004 #include "tao/LF_Follower.h"
00005 #include "tao/Leader_Follower.h"
00006 #include "ace/Guard_T.h"
00007 #include "ace/Log_Msg.h"
00008 
00009 ACE_RCSID (tao,
00010            LF_Strategy_Complete,
00011            "LF_Strategy_Complete.cpp,v 1.6 2006/04/19 09:01:20 jwillemsen Exp")
00012 
00013 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00014 
00015 TAO_LF_Strategy_Complete::~TAO_LF_Strategy_Complete (void)
00016 {
00017 }
00018 
00019 void
00020 TAO_LF_Strategy_Complete::set_upcall_thread (TAO_Leader_Follower &lf)
00021 {
00022   lf.set_upcall_thread ();
00023 }
00024 
00025 int
00026 TAO_LF_Strategy_Complete::set_event_loop_thread (ACE_Time_Value *tv,
00027                                                  TAO_Leader_Follower &lf)
00028 {
00029   ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, lf.lock (), -1);
00030 
00031   return lf.set_event_loop_thread (tv);
00032 }
00033 
00034 void
00035 TAO_LF_Strategy_Complete::reset_event_loop_thread (int call_reset,
00036                                                    TAO_Leader_Follower &lf)
00037 {
00038   ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, lf.lock ());
00039 
00040   if (call_reset)
00041     lf.reset_event_loop_thread ();
00042 
00043   int const result = lf.elect_new_leader ();
00044 
00045   if (result == -1)
00046     ACE_ERROR ((LM_ERROR,
00047                 ACE_TEXT ("TAO (%P|%t) Failed to wake up ")
00048                 ACE_TEXT ("a follower thread\n")));
00049 }
00050 
00051 TAO_END_VERSIONED_NAMESPACE_DECL

Generated on Thu Nov 9 11:54:15 2006 for TAO by doxygen 1.3.6