3 //=============================================================================
5 * @file CSD_TP_Synch_Helper.h
7 * @author Tim Bradley <bradley_t@ociweb.com>
9 //=============================================================================
11 #ifndef TAO_CSD_TP_SYNCH_HELPER_H
12 #define TAO_CSD_TP_SYNCH_HELPER_H
14 #include /**/ "ace/pre.h"
16 #include "tao/CSD_ThreadPool/CSD_TP_Export.h"
17 #include "tao/Condition.h"
19 #if !defined (ACE_LACKS_PRAGMA_ONCE)
21 #endif /* ACE_LACKS_PRAGMA_ONCE */
23 #include "ace/Synch.h"
25 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
32 * @class TP_Synch_Helper
34 * @brief Helper class for synchronous requests to block the requesting
35 * thread until the appropriate time (when it will be un-blocked).
37 * TBD - Description here
40 class TAO_CSD_TP_Export TP_Synch_Helper
43 /// Constructor. Sets initial state to PENDING.
49 /// Returns true if the helper state is DISPATCHED, and false if
50 /// the helper state is CANCELLED. However, if the helper state
51 /// is PENDING, then this method will block the calling thread
52 /// until the state changes to something other than PENDING
53 /// (ie, DISPATCHED or CANCELLED).
54 bool wait_while_pending();
56 /// Change the state of this helper to DISPATCHED, which will cause
57 /// wait_while_pending() to unblock.
60 /// Change the state of this helper to CANCELLED, which will cause
61 /// wait_while_pending() to unblock.
65 /// Enumeration Type for all possible states of this helper object.
74 typedef TAO_SYNCH_MUTEX LockType
;
76 /// Thread condition type
77 typedef TAO_Condition
<LockType
> ConditionType
;
79 /// Lock used to protect the state and condition.
82 /// Used to denote the state of the request dispatching.
85 /// The condition used to block the calling thread until the
86 /// state is something other than the PENDING state.
87 ConditionType condition_
;
92 TAO_END_VERSIONED_NAMESPACE_DECL
94 #if defined (__ACE_INLINE__)
95 # include "tao/CSD_ThreadPool/CSD_TP_Synch_Helper.inl"
96 #endif /* __ACE_INLINE__ */
98 #include /**/ "ace/post.h"
100 #endif /* TAO_CSD_TP_SYNCH_HELPER_H */