3 //==========================================================================
5 * @file Null_Condition.h
7 * @author Douglas C. Schmidt <d.schmidt@vanderbilt.edu>
9 //==========================================================================
11 #ifndef ACE_NULL_CONDITION_H
12 #define ACE_NULL_CONDITION_H
13 #include /**/ "ace/pre.h"
15 #include "ace/Null_Mutex.h"
16 #include "ace/Condition_T.h"
18 #if !defined (ACE_LACKS_PRAGMA_ONCE)
20 #endif /* ACE_LACKS_PRAGMA_ONCE */
22 #include "ace/os_include/os_errno.h"
24 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
27 class ACE_Condition_Attributes
;
28 template <class MUTEX
> class ACE_Condition
;
31 * @brief ACE_Condition template specialization written using
32 * ACE_Null_Mutexes. Implements a do nothing ACE_Condition
33 * specialization, i.e., all methods are no ops.
36 class ACE_Condition
<ACE_Null_Mutex
>
39 ACE_Condition (const ACE_Null_Mutex
&m
,
40 const ACE_TCHAR
* = 0,
42 : mutex_ ((ACE_Null_Mutex
&) m
) {}
44 ACE_Condition (const ACE_Null_Mutex
&m
,
45 const ACE_Condition_Attributes
&,
46 const ACE_TCHAR
* = 0,
48 : mutex_ ((ACE_Null_Mutex
&) m
) {}
50 ~ACE_Condition () = default;
53 int remove () {return 0;}
55 /// Returns -1 with @c errno == @c ETIME.
56 int wait (const ACE_Time_Value
* = 0) {errno
= ETIME
; return -1;}
58 /// Returns -1 with @c errno == @c ETIME.
59 int wait (ACE_Null_Mutex
&,
60 const ACE_Time_Value
* = 0) {errno
= ETIME
; return -1;}
63 int signal () {return 0;}
66 int broadcast () {return 0;}
67 ACE_Null_Mutex
&mutex () {return this->mutex_
;}
69 /// Dump the state of an object.
72 // ACE_ALLOC_HOOK_DECLARE;
73 // Declare the dynamic allocation hooks.
76 ACE_Null_Mutex
&mutex_
; // Reference to mutex lock.
79 void operator= (const ACE_Condition
<ACE_Null_Mutex
> &) = delete;
80 ACE_Condition (const ACE_Condition
<ACE_Null_Mutex
> &) = delete;
83 typedef ACE_Condition
<ACE_Null_Mutex
> ACE_Null_Condition
;
85 ACE_END_VERSIONED_NAMESPACE_DECL
87 #include /**/ "ace/post.h"
88 #endif /* ACE_NULL_CONDITION_H */