blob: 67472a494293ea95013cbc9c18e79a4cf1acecac (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
// $Id$
#include "tao/LF_Strategy_Complete.h"
#include "tao/LF_Follower.h"
#include "tao/Leader_Follower.h"
#include "ace/Guard_T.h"
#include "tao/debug.h"
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
TAO_LF_Strategy_Complete::~TAO_LF_Strategy_Complete (void)
{
}
void
TAO_LF_Strategy_Complete::set_upcall_thread (TAO_Leader_Follower &lf)
{
lf.set_upcall_thread ();
}
int
TAO_LF_Strategy_Complete::set_event_loop_thread (ACE_Time_Value *tv,
TAO_Leader_Follower &lf)
{
ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, lf.lock (), -1);
return lf.set_event_loop_thread (tv);
}
void
TAO_LF_Strategy_Complete::reset_event_loop_thread (int call_reset,
TAO_Leader_Follower &lf)
{
ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, lf.lock ());
if (call_reset)
lf.reset_event_loop_thread ();
int const result = lf.elect_new_leader ();
if (result == -1)
TAOLIB_ERROR ((LM_ERROR,
ACE_TEXT ("TAO (%P|%t) - Failed to wake up ")
ACE_TEXT ("a follower thread\n")));
}
TAO_END_VERSIONED_NAMESPACE_DECL
|