#include <LF_Strategy_Complete.h>
Inheritance diagram for TAO_LF_Strategy_Complete:


Public Member Functions | |
Virtual Methods | |
| virtual | ~TAO_LF_Strategy_Complete (void) |
| virtual void | set_upcall_thread (TAO_Leader_Follower &) |
| The current thread will handle an upcall. | |
| virtual int | set_event_loop_thread (ACE_Time_Value *max_wait_time, TAO_Leader_Follower &) |
| The current thread is entering the reactor event loop. | |
| virtual void | reset_event_loop_thread (int call_reset, TAO_Leader_Follower &) |
| The current thread is leaving the event loop. | |
Definition at line 34 of file LF_Strategy_Complete.h.
|
|
Definition at line 15 of file LF_Strategy_Complete.cpp.
00016 {
00017 }
|
|
||||||||||||
|
The current thread is leaving the event loop. When the thread leaves the event loop a new leader must be elected. Implements TAO_LF_Strategy. Definition at line 35 of file LF_Strategy_Complete.cpp. References ACE_ERROR, ACE_GUARD, ACE_TEXT, TAO_Leader_Follower::elect_new_leader(), LM_ERROR, TAO_Leader_Follower::lock(), TAO_Leader_Follower::reset_event_loop_thread(), and TAO_SYNCH_MUTEX.
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 }
|
|
||||||||||||
|
The current thread is entering the reactor event loop. Threads that block in the reactor event loop become "server" threads for the Leader/Follower set. They must be flagged specially because they do not wait for one specific event, but for any event whatsoever. Implements TAO_LF_Strategy. Definition at line 26 of file LF_Strategy_Complete.cpp. References ACE_GUARD_RETURN, TAO_Leader_Follower::lock(), TAO_Leader_Follower::set_event_loop_thread(), and TAO_SYNCH_MUTEX.
00028 {
00029 ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, lf.lock (), -1);
00030
00031 return lf.set_event_loop_thread (tv);
00032 }
|
|
|
The current thread will handle an upcall. Threads that handle requests can block for long periods of time, causing deadlocks if they don't elect a new leader before starting the upcall the system can become non-responsive or dead-lock. Implements TAO_LF_Strategy. Definition at line 20 of file LF_Strategy_Complete.cpp. References TAO_Leader_Follower::set_upcall_thread().
00021 {
00022 lf.set_upcall_thread ();
00023 }
|
1.3.6