1 #include "ace/Synch_Options.h"
3 #include "ace/Global_Macros.h"
4 #include "ace/config-all.h"
6 #if defined (ACE_HAS_ALLOC_HOOKS)
7 # include "ace/Malloc_Base.h"
8 #endif /* ACE_HAS_ALLOC_HOOKS */
10 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
12 ACE_ALLOC_HOOK_DEFINE (ACE_Synch_Options
)
15 ACE_Synch_Options::dump () const
17 #if defined (ACE_HAS_DUMP)
18 ACE_TRACE ("ACE_Synch_Options::dump");
19 #endif /* ACE_HAS_DUMP */
22 // Static initialization.
23 // Note: these three objects require static construction and destruction.
26 ACE_Synch_Options
ACE_Synch_Options::defaults
;
29 ACE_Synch_Options
ACE_Synch_Options::synch
;
32 ACE_Synch_Options
ACE_Synch_Options::asynch (ACE_Synch_Options::USE_REACTOR
);
34 ACE_Synch_Options::ACE_Synch_Options (unsigned long options
,
35 const ACE_Time_Value
&timeout
,
38 // ACE_TRACE ("ACE_Synch_Options::ACE_Synch_Options");
39 this->set (options
, timeout
, arg
);
43 ACE_Synch_Options::set (unsigned long options
,
44 const ACE_Time_Value
&timeout
,
47 // ACE_TRACE ("ACE_Synch_Options::set");
48 this->options_
= options
;
49 this->timeout_
= timeout
;
52 * Not using ACE_Time_Value::zero because of possible static init order
53 * dependence. It would work fine because the memory would all zeros anyways,
54 * but ubsan complains about it.
56 if (timeout_
!= ACE_Time_Value(0))
57 ACE_SET_BITS (this->options_
, ACE_Synch_Options::USE_TIMEOUT
);
63 ACE_Synch_Options::operator[] (unsigned long option
) const
65 ACE_TRACE ("ACE_Synch_Options::operator[]");
66 return (this->options_
& option
) != 0;
70 ACE_Synch_Options::operator= (unsigned long option
)
72 ACE_TRACE ("ACE_Synch_Options::operator=");
73 this->options_
|= option
;
76 const ACE_Time_Value
&
77 ACE_Synch_Options::timeout () const
79 ACE_TRACE ("ACE_Synch_Options::timeout");
80 return this->timeout_
;
84 ACE_Synch_Options::timeout (const ACE_Time_Value
&tv
)
86 ACE_TRACE ("ACE_Synch_Options::timeout");
90 const ACE_Time_Value
*
91 ACE_Synch_Options::time_value () const
93 ACE_TRACE ("ACE_Synch_Options::time_value");
94 return (*this)[USE_TIMEOUT
] ? &this->timeout_
: 0;
98 ACE_Synch_Options::arg () const
100 ACE_TRACE ("ACE_Synch_Options::arg");
105 ACE_Synch_Options::arg (const void *a
)
107 ACE_TRACE ("ACE_Synch_Options::arg");
111 ACE_END_VERSIONED_NAMESPACE_DECL