summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarshall Clow <mclow.lists@gmail.com>2017-01-09 22:32:11 +0000
committerMarshall Clow <mclow.lists@gmail.com>2017-01-09 22:32:11 +0000
commit04b9853a97f2f2e88fbee474bbe9c0fc4d916598 (patch)
tree326ee64a4714a627b8258fa290407a0fe4dcfeec
parent46d134c4abd9508b8e5ce40ed54064276258f923 (diff)
downloadbcm5719-llvm-04b9853a97f2f2e88fbee474bbe9c0fc4d916598.tar.gz
bcm5719-llvm-04b9853a97f2f2e88fbee474bbe9c0fc4d916598.zip
Swap two lines in __mutex_base. On systems with high clock rates, we could mistakenly return no_timeout when a mutex had timed out if we got a tick between these two lines. Thanks to Brian Cain for the bug report.
llvm-svn: 291492
-rw-r--r--libcxx/include/__mutex_base2
1 files changed, 1 insertions, 1 deletions
diff --git a/libcxx/include/__mutex_base b/libcxx/include/__mutex_base
index cce928784a4..21638ee3292 100644
--- a/libcxx/include/__mutex_base
+++ b/libcxx/include/__mutex_base
@@ -410,8 +410,8 @@ condition_variable::wait_for(unique_lock<mutex>& __lk,
typedef time_point<system_clock, duration<long double, nano> > __sys_tpf;
typedef time_point<system_clock, nanoseconds> __sys_tpi;
__sys_tpf _Max = __sys_tpi::max();
- system_clock::time_point __s_now = system_clock::now();
steady_clock::time_point __c_now = steady_clock::now();
+ system_clock::time_point __s_now = system_clock::now();
if (_Max - __d > __s_now)
__do_timed_wait(__lk, __s_now + __ceil<nanoseconds>(__d));
else
OpenPOWER on IntegriCloud