diff options
author | Fred Hornsey <hornseyf@objectcomputing.com> | 2019-12-20 16:59:03 -0600 |
---|---|---|
committer | Fred Hornsey <hornseyf@objectcomputing.com> | 2019-12-20 17:07:31 -0600 |
commit | 06ee4ac4822a084fcdb296f00356721283bb158c (patch) | |
tree | 2510e670eb478236815967dcd7f622bc17e566da /ACE/ace/Synch_Options.cpp | |
parent | 77a212244fc64003da9f078738b4fa0863595210 (diff) | |
download | ATCD-06ee4ac4822a084fcdb296f00356721283bb158c.tar.gz |
Use ACE_Time_Value(0) in ACE_Sync_Options::set
Respond to Review in https://github.com/DOCGroup/ACE_TAO/pull/1010
Diffstat (limited to 'ACE/ace/Synch_Options.cpp')
-rw-r--r-- | ACE/ace/Synch_Options.cpp | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/ACE/ace/Synch_Options.cpp b/ACE/ace/Synch_Options.cpp index 460e36569b0..91f5cd1f874 100644 --- a/ACE/ace/Synch_Options.cpp +++ b/ACE/ace/Synch_Options.cpp @@ -48,17 +48,12 @@ ACE_Synch_Options::set (unsigned long options, this->options_ = options; this->timeout_ = timeout; - // Whoa, possible dependence on static initialization here. This - // function is called during initialization of the statics above. - // But, ACE_Time_Value::zero is a static object. Very fortunately, - // its bits have a value of 0. - if (timeout_ != -#ifdef ACE_INITIALIZE_MEMORY_BEFORE_USE - ACE_Time_Value (0) // For satisfying clang's undefined behavior sanitizer -#else - ACE_Time_Value::zero -#endif - ) + /* + * Not using ACE_Time_Value::zero because of possible static init order + * dependence. It would work fine because the memory would all zeros anyways, + * but ubsan complains about it. + */ + if (timeout_ != ACE_Time_Value(0)) ACE_SET_BITS (this->options_, ACE_Synch_Options::USE_TIMEOUT); this->arg_ = arg; |