diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2014-03-17 09:52:07 +0000 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2014-03-17 09:52:07 +0000 |
commit | 90a9fde21d2740a082aea34d312934b117612e45 (patch) | |
tree | 528d32d1a131a109cc2fa2cc17fce39787eca11c /ACE/ace/IO_SAP.cpp | |
parent | 53fb4ee9fbf7c04908a78ea034f4af74b6cf6ee4 (diff) | |
download | ATCD-90a9fde21d2740a082aea34d312934b117612e45.tar.gz |
Mon Mar 17 09:52:03 UTC 2014 Johnny Willemsen <jwillemsen@remedy.nl>
* ace/IO_SAP.h:
* ace/IO_SAP.cpp:
* ace/IPC_SAP.cpp:
* ace/IPC_SAP.h:
Don't try to cache the process id, but just call the ACE OS
method when needed (which is just in some cases and the operation
is inline). Fixes possible data races reported by Intel Inspector
XE.
Diffstat (limited to 'ACE/ace/IO_SAP.cpp')
-rw-r--r-- | ACE/ace/IO_SAP.cpp | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/ACE/ace/IO_SAP.cpp b/ACE/ace/IO_SAP.cpp index e9257ec5482..d11adf60e1b 100644 --- a/ACE/ace/IO_SAP.cpp +++ b/ACE/ace/IO_SAP.cpp @@ -33,21 +33,14 @@ ACE_IO_SAP::dump (void) const ACELIB_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); ACELIB_DEBUG ((LM_DEBUG, ACE_TEXT ("handle_ = %d"), this->handle_)); - ACELIB_DEBUG ((LM_DEBUG, ACE_TEXT ("\npid_ = %d"), this->pid_)); ACELIB_DEBUG ((LM_DEBUG, ACE_END_DUMP)); #endif /* ACE_HAS_DUMP */ } -// Cache for the process ID. -pid_t ACE_IO_SAP::pid_ = 0; - int ACE_IO_SAP::enable (int value) const { ACE_TRACE ("ACE_IO_SAP::enable"); - /* First-time in initialization. */ - if (ACE_IO_SAP::pid_ == 0) - ACE_IO_SAP::pid_ = ACE_OS::getpid (); switch (value) { @@ -57,7 +50,7 @@ ACE_IO_SAP::enable (int value) const #if defined (F_SETOWN) return ACE_OS::fcntl (this->handle_, F_SETOWN, - ACE_IO_SAP::pid_); + ACE_OS::getpid ()); #else ACE_NOTSUP_RETURN (-1); #endif /* F_SETOWN */ @@ -68,7 +61,7 @@ ACE_IO_SAP::enable (int value) const #if defined (F_SETOWN) && defined (FASYNC) if (ACE_OS::fcntl (this->handle_, F_SETOWN, - ACE_IO_SAP::pid_) == -1 + ACE_OS::getpid ()) == -1 || ACE::set_flags (this->handle_, FASYNC) == -1) return -1; |