3 //==========================================================================
5 * @file Null_Condition.h
9 * @author Douglas C. Schmidt <d.schmidt@vanderbilt.edu>
11 //==========================================================================
13 #ifndef ACE_NULL_CONDITION_H
14 #define ACE_NULL_CONDITION_H
15 #include /**/ "ace/pre.h"
17 #include "ace/Null_Mutex.h"
18 #include "ace/Condition_T.h"
20 #if !defined (ACE_LACKS_PRAGMA_ONCE)
22 #endif /* ACE_LACKS_PRAGMA_ONCE */
24 #include "ace/os_include/os_errno.h"
26 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
29 class ACE_Condition_Attributes
;
30 template <class MUTEX
> class ACE_Condition
;
33 * @brief ACE_Condition template specialization written using
34 * ACE_Null_Mutexes. Implements a do nothing ACE_Condition
35 * specialization, i.e., all methods are no ops.
38 class ACE_Condition
<ACE_Null_Mutex
>
41 ACE_Condition (const ACE_Null_Mutex
&m
,
42 const ACE_TCHAR
* = 0,
44 : mutex_ ((ACE_Null_Mutex
&) m
) {}
46 ACE_Condition (const ACE_Null_Mutex
&m
,
47 const ACE_Condition_Attributes
&,
48 const ACE_TCHAR
* = 0,
50 : mutex_ ((ACE_Null_Mutex
&) m
) {}
52 ~ACE_Condition (void) {}
55 int remove (void) {return 0;}
57 /// Returns -1 with @c errno == @c ETIME.
58 int wait (const ACE_Time_Value
* = 0) {errno
= ETIME
; return -1;}
60 /// Returns -1 with @c errno == @c ETIME.
61 int wait (ACE_Null_Mutex
&,
62 const ACE_Time_Value
* = 0) {errno
= ETIME
; return -1;}
65 int signal (void) {return 0;}
68 int broadcast (void) {return 0;}
69 ACE_Null_Mutex
&mutex (void) {return this->mutex_
;};
71 /// Dump the state of an object.
72 void dump (void) const {}
74 // ACE_ALLOC_HOOK_DECLARE;
75 // Declare the dynamic allocation hooks.
78 ACE_Null_Mutex
&mutex_
; // Reference to mutex lock.
81 // = Prevent assignment and initialization.
82 void operator= (const ACE_Condition
<ACE_Null_Mutex
> &);
83 ACE_Condition (const ACE_Condition
<ACE_Null_Mutex
> &);
86 typedef ACE_Condition
<ACE_Null_Mutex
> ACE_Null_Condition
;
88 ACE_END_VERSIONED_NAMESPACE_DECL
90 #include /**/ "ace/post.h"
91 #endif /* ACE_NULL_CONDITION_H */