diff options
author | bala <balanatarajan@users.noreply.github.com> | 2003-01-01 00:34:10 +0000 |
---|---|---|
committer | bala <balanatarajan@users.noreply.github.com> | 2003-01-01 00:34:10 +0000 |
commit | 382d8c883f07bb1b1c82b443af35a82bfcd2686f (patch) | |
tree | 7f2df6b5954622963a22f7929183878884116b64 /TAO/tao | |
parent | 3d8a5953a0fbcdbc9d10ebc980877259118924fa (diff) | |
download | ATCD-382d8c883f07bb1b1c82b443af35a82bfcd2686f.tar.gz |
ChangeLogTag: Tue Dec 31 19:33:09 2002 Balachandran Natarajan <bala@isis-server.isis.vanderbilt.edu>
Diffstat (limited to 'TAO/tao')
-rw-r--r-- | TAO/tao/Condition.cpp | 2 | ||||
-rw-r--r-- | TAO/tao/Condition.h | 2 | ||||
-rw-r--r-- | TAO/tao/Leader_Follower.cpp | 22 |
3 files changed, 16 insertions, 10 deletions
diff --git a/TAO/tao/Condition.cpp b/TAO/tao/Condition.cpp index 862e9e5bab4..1ec9ea7cfbb 100644 --- a/TAO/tao/Condition.cpp +++ b/TAO/tao/Condition.cpp @@ -1,7 +1,7 @@ #ifndef TAO_CONDITION_CPP #define TAO_CONDITION_CPP #include "Condition.h" - +#include "ace/Log_Msg.h" #if !defined (__ACE_INLINE__) # include "tao/Condition.inl" diff --git a/TAO/tao/Condition.h b/TAO/tao/Condition.h index c5b7e065636..b27ac808011 100644 --- a/TAO/tao/Condition.h +++ b/TAO/tao/Condition.h @@ -19,6 +19,8 @@ #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ +#include "ace/Synch_T.h" +#include "ace/Global_Macros.h" class ACE_Time_Value; diff --git a/TAO/tao/Leader_Follower.cpp b/TAO/tao/Leader_Follower.cpp index a00b71b3ee5..0f11bad8bb4 100644 --- a/TAO/tao/Leader_Follower.cpp +++ b/TAO/tao/Leader_Follower.cpp @@ -179,6 +179,10 @@ TAO_Leader_Follower::wait_for_event (TAO_LF_Event *event, // Optmize the first iteration [no access to errno] int result = 1; + // For some cases the transport may dissappear like when waiting for + // connection to be initiated or closed. So cache the id. + int t_id = transport->id (); + { // Calls this->set_client_thread () on construction and // this->reset_client_thread () on destruction. @@ -202,7 +206,7 @@ TAO_Leader_Follower::wait_for_event (TAO_LF_Event *event, ACE_DEBUG ((LM_DEBUG, "TAO (%P|%t) - Leader_Follower[%d]::wait_for_event," " (follower), cond <%x>\n", - transport->id (), follower.get ())); + t_id, follower.get ())); // Bound the follower and the LF_Event, this is important to // get a signal when the event terminates @@ -247,7 +251,7 @@ TAO_Leader_Follower::wait_for_event (TAO_LF_Event *event, ACE_DEBUG ((LM_DEBUG, "TAO (%P|%t) - Leader_Follower[%d]::wait_for_event, " " (follower) [no timer, cond failed]\n", - transport->id ())); + t_id)); // @@ Michael: What is our error handling in this case? // We could be elected as leader and @@ -266,7 +270,7 @@ TAO_Leader_Follower::wait_for_event (TAO_LF_Event *event, ACE_DEBUG ((LM_DEBUG, "TAO (%P|%t) - Leader_Follower[%d]::wait, " "(follower) [has timer, follower failed]\n", - transport->id ())); + t_id )); // We have timedout.. So set the state in the // LF_Event about this.. We call the non-locking, @@ -295,7 +299,7 @@ TAO_Leader_Follower::wait_for_event (TAO_LF_Event *event, ACE_ERROR ((LM_ERROR, "TAO (%P|%t) - Leader_Follower[%d]::wait_for_event, " "elect_new_leader failed\n", - transport->id ())); + t_id )); } } @@ -317,7 +321,7 @@ TAO_Leader_Follower::wait_for_event (TAO_LF_Event *event, ACE_DEBUG ((LM_DEBUG, "TAO (%P|%t) - Leader_Follower[%d]::wait_for_event," " done (follower), successful %d\n", - transport->id (), + t_id, event->successful ())); // Now somebody woke us up to become a leader or to handle our @@ -363,7 +367,7 @@ TAO_Leader_Follower::wait_for_event (TAO_LF_Event *event, ACE_DEBUG ((LM_DEBUG, "TAO (%P|%t) - Leader_Follower[%d]::wait_for_event," " (leader) enter reactor event loop\n", - transport->id ())); + t_id)); // If we got our event, no need to run the event loop any // further. @@ -389,7 +393,7 @@ TAO_Leader_Follower::wait_for_event (TAO_LF_Event *event, ACE_DEBUG ((LM_DEBUG, "TAO (%P|%t) - Leader_Follower[%d]::wait_for_event," " (leader) exit reactor event loop\n", - transport->id ())); + t_id)); } } // @@ -409,14 +413,14 @@ TAO_Leader_Follower::wait_for_event (TAO_LF_Event *event, ACE_ERROR_RETURN ((LM_ERROR, "TAO (%P|%t) - Leader_Follower[%d]::wait_for_event," " failed to elect new leader\n", - transport->id()), + t_id), -1); if (result == -1) ACE_ERROR_RETURN ((LM_ERROR, "TAO (%P|%t) - Leader_Follower[%d]::wait_for_event," " handle_events failed\n", - transport->id()), + t_id), -1); // Return an error if there was a problem receiving the reply... |