cxx/include
Eric Fiselier 1d55ecf513 [libcxx] Fix bug in shared_timed_mutex that could cause a program to hang.
Summary:
The summary of the bug, provided by Stephan T. Lavavej:

In shared_timed_mutex::try_lock_until() (line 195 in 3.6.0), you need to deliver a notification.  The scenario is:
 
* There are N threads holding the shared lock.
* One thread calls try_lock_until() to attempt to acquire the exclusive lock.  It sets the "I want to write" bool/bit, then waits for the N readers to drain away.
* K more threads attempt to acquire the shared lock, but they notice that someone said "I want to write", so they block on a condition_variable.
* At least one of the N readers is stubborn and doesn't release the shared lock.
* The wannabe-writer times out, gives up, and unsets the "I want to write" bool/bit.
 
At this point, a notification (it needs to be notify_all) must be delivered to the condition_variable that the K wannabe-readers are waiting on.  Otherwise, they can block forever without waking up.



Reviewers: mclow.lists, jyasskin

Reviewed By: jyasskin

Subscribers: jyasskin, cfe-commits

Differential Revision: http://reviews.llvm.org/D8796

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@233944 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-02 21:02:06 +00:00
..
2015-02-05 02:34:59 +00:00
2011-10-17 20:05:10 +00:00
2011-10-17 20:05:10 +00:00
2011-10-17 20:05:10 +00:00
2011-10-17 20:05:10 +00:00
2011-10-17 20:05:10 +00:00
2011-10-17 20:05:10 +00:00
2011-10-17 20:05:10 +00:00
2011-10-17 20:05:10 +00:00
2013-10-05 21:19:49 +00:00
2011-10-17 20:05:10 +00:00
2011-10-17 20:05:10 +00:00
2011-10-17 20:05:10 +00:00
2011-10-17 20:05:10 +00:00
2011-10-17 20:05:10 +00:00
2014-05-16 01:45:02 +00:00
2011-10-17 20:05:10 +00:00
2011-10-17 20:05:10 +00:00
2011-10-17 20:05:10 +00:00
2011-10-17 20:05:10 +00:00
2014-11-26 17:51:58 +00:00
2011-10-17 20:05:10 +00:00