summaryrefslogtreecommitdiff
path: root/tao/Wait_On_LF_No_Upcall.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tao/Wait_On_LF_No_Upcall.cpp')
-rw-r--r--tao/Wait_On_LF_No_Upcall.cpp43
1 files changed, 22 insertions, 21 deletions
diff --git a/tao/Wait_On_LF_No_Upcall.cpp b/tao/Wait_On_LF_No_Upcall.cpp
index f97d32ae5ae..7396c2d1e7a 100644
--- a/tao/Wait_On_LF_No_Upcall.cpp
+++ b/tao/Wait_On_LF_No_Upcall.cpp
@@ -10,6 +10,7 @@
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
class TAO_Transport;
+
namespace TAO
{
/**
@@ -24,7 +25,7 @@ namespace TAO
public:
// Maybe we should instead just take in a ptr to
// TAO_ORB_Core_TSS_Resources? Or at least ORB_Core*?
- Nested_Upcall_Guard (TAO_Transport *t)
+ explicit Nested_Upcall_Guard (TAO_Transport *t)
: t_ (t)
{
TAO_ORB_Core_TSS_Resources *tss =
@@ -34,45 +35,41 @@ namespace TAO
if (TAO_debug_level > 6)
ACE_DEBUG ((LM_DEBUG,
- "TAO (%P|%t) - Wait_On_LF_No_Upcall::wait "
- "disabling upcalls on thread %t\n"));
+ "TAO (%P|%t) - Wait_On_LF_No_Upcall[%d]::wait, "
+ "disabling upcalls\n", t->id ()));
}
~Nested_Upcall_Guard (void)
{
- TAO_ORB_Core_TSS_Resources *tss = t_->orb_core ()->get_tss_resources ();
+ TAO_ORB_Core_TSS_Resources *tss =
+ this->t_->orb_core ()->get_tss_resources ();
tss->upcalls_temporarily_suspended_on_this_thread_ = false;
if (TAO_debug_level > 6)
{
ACE_DEBUG ((LM_DEBUG,
- "TAO (%P|%t) - Wait_On_LF_No_Upcall::wait "
- "re-enabling upcalls on thread %t\n"));
+ "TAO (%P|%t) - Wait_On_LF_No_Upcall[%d]::wait, "
+ "re-enabling upcalls\n", this->t_->id ()));
}
}
private:
-
- Nested_Upcall_Guard (void)
- {
- }
+ Nested_Upcall_Guard (void);
/// Disallow copying and assignment.
Nested_Upcall_Guard (const Nested_Upcall_Guard&);
Nested_Upcall_Guard &operator= (const Nested_Upcall_Guard&);
private:
-
/// Pointer to the transport that we plan to use.
TAO_Transport *t_;
};
-
//=================================================================
Wait_On_LF_No_Upcall::Wait_On_LF_No_Upcall (TAO_Transport *t)
- : base (t)
+ : TAO_Wait_On_Leader_Follower (t)
{
}
@@ -86,19 +83,23 @@ namespace TAO
{
Nested_Upcall_Guard upcall_guard (this->transport_);
- return base::wait (max_wait_time, rd);
+ return TAO_Wait_On_Leader_Follower::wait (max_wait_time, rd);
}
bool
Wait_On_LF_No_Upcall::can_process_upcalls (void) const
{
- TAO_ORB_Core_TSS_Resources *tss =
- this->transport_->orb_core ()->get_tss_resources ();
-
- if ((this->transport_->opened_as () == TAO::TAO_CLIENT_ROLE) &&
- (this->transport_->bidirectional_flag () == 0) &&
- (tss->upcalls_temporarily_suspended_on_this_thread_))
- return false;
+ if ((this->transport_->opened_as () == TAO::TAO_SERVER_ROLE) &&
+ (this->transport_->bidirectional_flag () == -1))
+ {
+ TAO_ORB_Core_TSS_Resources *tss =
+ this->transport_->orb_core ()->get_tss_resources ();
+
+ if (tss->upcalls_temporarily_suspended_on_this_thread_)
+ {
+ return false;
+ }
+ }
return true;
}