[Boost-bugs] [Boost C++ Libraries] #5844: read_write_mutex.cpp: suffers race condition

Subject: [Boost-bugs] [Boost C++ Libraries] #5844: read_write_mutex.cpp: suffers race condition
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-08-30 07:54:53


#5844: read_write_mutex.cpp: suffers race condition
--------------------------------+-------------------------------------------
 Reporter: noloader@… | Owner:
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: None
  Version: Boost 1.47.0 | Severity: Problem
 Keywords: |
--------------------------------+-------------------------------------------
 It appears race conditions exist in read_write_mutex.cpp.

 class adjust_count, class adjust_dual_count,
 read_write_mutex_impl<Mutex>::do_read_unlock(). Example from
 adjust_dual_count:

 {{{
 void adjust_now(void)
 {
   BOOST_ASSERT(max_count_ >= count_);

   if (adjust_)
   {
     BOOST_ASSERT(max_count_ > 0);
     if (count_ > 0)
       --count_;
     if (max_count_ > 0)
       --max_count_;
   }
   else
   {
     BOOST_ASSERT(max_count_ >= 0);
   }
   adjust_ = false;
 }
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/5844>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:07 UTC