3 //=============================================================================
5 * @file Nested_Upcall_Guard.h
7 * @author Chris Cleeland <cleeland@ociweb.com>
9 //=============================================================================
12 #ifndef TAO_NESTED_UPCALL_GUARD_H
13 #define TAO_NESTED_UPCALL_GUARD_H
15 #include /**/ "ace/pre.h"
17 #if !defined (ACE_LACKS_PRAGMA_ONCE)
19 #endif /* ACE_LACKS_PRAGMA_ONCE */
21 #include "tao/Transport.h"
22 #include "tao/ORB_Core.h"
23 #include "tao/ORB_Core_TSS_Resources.h"
24 #include "tao/debug.h"
26 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
30 * @class Nested_Upcall_Guard
32 * @brief: Magic class that sets the status of the thread in the
35 * This class was originally internal to the Wait_On_LF_NoUpcall
36 * implementation, but now it needs to be shared with the LF
37 * Connect wait as well.
39 class Nested_Upcall_Guard
42 // Maybe we should instead just take in a ptr to
43 // TAO_ORB_Core_TSS_Resources? Or at least ORB_Core*?
44 explicit Nested_Upcall_Guard (TAO_Transport
*t
, bool enable
=true)
53 TAO_ORB_Core_TSS_Resources
*tss
=
54 t_
->orb_core ()->get_tss_resources ();
56 tss
->upcalls_temporarily_suspended_on_this_thread_
= true;
58 if (TAO_debug_level
> 6)
59 TAOLIB_DEBUG ((LM_DEBUG
,
60 "TAO (%P|%t) - Wait_On_LF_No_Upcall[%d]::wait, "
61 "disabling upcalls\n", t
->id ()));
64 ~Nested_Upcall_Guard ()
71 TAO_ORB_Core_TSS_Resources
*tss
=
72 this->t_
->orb_core ()->get_tss_resources ();
74 tss
->upcalls_temporarily_suspended_on_this_thread_
= false;
76 if (TAO_debug_level
> 6)
78 TAOLIB_DEBUG ((LM_DEBUG
,
79 "TAO (%P|%t) - Wait_On_LF_No_Upcall[%d]::wait, "
80 "re-enabling upcalls\n", this->t_
->id ()));
85 Nested_Upcall_Guard ();
87 Nested_Upcall_Guard (const Nested_Upcall_Guard
&) = delete;
88 Nested_Upcall_Guard
&operator= (const Nested_Upcall_Guard
&) = delete;
89 Nested_Upcall_Guard (Nested_Upcall_Guard
&&) = delete;
90 Nested_Upcall_Guard
&operator= (Nested_Upcall_Guard
&&) = delete;
93 /// Pointer to the transport that we plan to use.
96 /// A flag to support conditional waiting in the LF_Connect_Strategy
101 TAO_END_VERSIONED_NAMESPACE_DECL
103 #include /**/ "ace/post.h"
105 #endif /* TAO_NESTED_UPCALL_GUARD_H */