diff options
author | bala <bala@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2001-03-27 21:16:45 +0000 |
---|---|---|
committer | bala <bala@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2001-03-27 21:16:45 +0000 |
commit | 470675732dacbbaa2c6a5429d976662b764604c2 (patch) | |
tree | 5702c2da2272776f83c58714eebc49993faa32f4 /TAO/tao/Wait_On_Leader_Follower.cpp | |
parent | d9d8058001f213d613eb23c0d9cd342419724740 (diff) | |
download | ATCD-470675732dacbbaa2c6a5429d976662b764604c2.tar.gz |
ChangeLogTag: Tue Mar 27 15:08:41 2001 Balachandran Natarajan <bala@cs.wustl.edu>
Diffstat (limited to 'TAO/tao/Wait_On_Leader_Follower.cpp')
-rw-r--r-- | TAO/tao/Wait_On_Leader_Follower.cpp | 29 |
1 files changed, 9 insertions, 20 deletions
diff --git a/TAO/tao/Wait_On_Leader_Follower.cpp b/TAO/tao/Wait_On_Leader_Follower.cpp index 1028b7ed977..cd4f17d0e3a 100644 --- a/TAO/tao/Wait_On_Leader_Follower.cpp +++ b/TAO/tao/Wait_On_Leader_Follower.cpp @@ -91,9 +91,6 @@ TAO_Wait_On_Leader_Follower::wait (ACE_Time_Value *max_wait_time, this->transport_, cond)); - // Keep the entry on the stack - TAO_Leader_Follower::TAO_Follower_Node node (cond); - while (!reply_received && leader_follower.leader_available ()) { @@ -121,7 +118,7 @@ TAO_Wait_On_Leader_Follower::wait (ACE_Time_Value *max_wait_time, // lost. // - (void) leader_follower.add_follower (&node); + (void) leader_follower.add_follower (cond); if (max_wait_time == 0) { @@ -148,10 +145,10 @@ TAO_Wait_On_Leader_Follower::wait (ACE_Time_Value *max_wait_time, ACE_TEXT ("cond == 0 || cond->wait (tv) == -1\n"), this->transport_)); - if (leader_follower.remove_follower (&node) == -1) + if (leader_follower.remove_follower (cond) == -1) ACE_ERROR ((LM_ERROR, "TAO (%P|%t) TAO_Wait_On_Leader_Follower::wait - " - "remove_follower failed for <%x>\n", node.follower_)); + "remove_follower failed for <%x>\n", cond)); return -1; } @@ -164,16 +161,16 @@ TAO_Wait_On_Leader_Follower::wait (ACE_Time_Value *max_wait_time, // Cannot remove the follower here, we *must* remove it when // we signal it so the same condition is not signalled for // both wake up as a follower and as the next leader. - if (leader_follower.remove_follower (&node) == -1) + if (leader_follower.remove_follower (cond) == -1) ACE_ERROR ((LM_ERROR, "TAO (%P|%t) TAO_Wait_On_Leader_Follower::wait - " - "remove_follower failed for <%x>\n", node.follower)); + "remove_follower failed for <%x>\n", cond)); #endif /* 0 */ if (TAO_debug_level >= 5) ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("TAO (%P|%t) - done (follower) " - "on <%x>, reply_received %d\n"), + ACE_TEXT ("on <%x>, reply_received %d\n")), this->transport_, reply_received)); // Now somebody woke us up to become a leader or to handle our @@ -277,7 +274,7 @@ TAO_Wait_On_Leader_Follower::wait (ACE_Time_Value *max_wait_time, result = -1; errno = ETIME; } - else if (reply_received == -1) + else if (reply_received == -1) { // If the time did not expire yet, but we get a failure, // e.g. the connections closed, we should still return an error. @@ -319,10 +316,6 @@ TAO_Wait_On_Leader_Follower::reply_dispatched (int &reply_received_flag, reply_received_flag = 1; - // The following works as the node is assumed to be on the stack - // till the thread is alive. - TAO_Leader_Follower::TAO_Follower_Node node (condition); - // We *must* remove it when we signal it so the same condition // is not signalled for both wake up as a follower and as the // next leader. @@ -330,7 +323,7 @@ TAO_Wait_On_Leader_Follower::reply_dispatched (int &reply_received_flag, // the consumer is not yet waiting for it (i.e. it send the // request but has not blocked to receive the reply yet). // Ignore errors. - (void) leader_follower.remove_follower (&node); + (void) leader_follower.remove_follower (condition); if (condition->signal () == -1) return -1; @@ -353,11 +346,7 @@ TAO_Wait_On_Leader_Follower::connection_closed (int &reply_received_flag, reply_received_flag = -1; - // The following works as the node is assumed to be on the stack - // till the thread is alive. - TAO_Leader_Follower::TAO_Follower_Node node (condition); - - (void) leader_follower.remove_follower (&node); + (void) leader_follower.remove_follower (condition); (void) condition->signal (); } |