[Boost-bugs] [Boost C++ Libraries] #5502: race condition between shared_mutex timed_lock and lock_shared

Subject: [Boost-bugs] [Boost C++ Libraries] #5502: race condition between shared_mutex timed_lock and lock_shared
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-04-25 18:05:13


#5502: race condition between shared_mutex timed_lock and lock_shared
-------------------------------------+--------------------------------------
 Reporter: eliothorowitz@… | Owner: anthonyw
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: thread
  Version: Boost Release Branch | Severity: Showstopper
 Keywords: |
-------------------------------------+--------------------------------------
 There is a potential race condition between 3 threads.
 Thread 1 - has a shared lock
 Thread 2 - goes into a timed_lock loop with a small sleep
 Thread 3 - tries shared_lock

 Expected behavior: Thread 3 gets the lock when thread 2 fails to get
 exclusive lock.

 What happens: based on timing, there can be a race condition causing a
 hang unless Thread 1 releases the lock.

 Test and patch for boost-trunk that fixes the problem for me attached.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/5502>
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:06 UTC