diff options
author | Eric Fiselier <eric@efcs.ca> | 2015-06-12 00:41:34 +0000 |
---|---|---|
committer | Eric Fiselier <eric@efcs.ca> | 2015-06-12 00:41:34 +0000 |
commit | b3ec43d78aa2599e1592392844a7ec638fab7902 (patch) | |
tree | 3cd800dd82226b066717608877c112c0749afd78 /libcxx/src | |
parent | 03a9056f58e2f2d58fa8de12f836098f1488b29c (diff) | |
download | bcm5719-llvm-b3ec43d78aa2599e1592392844a7ec638fab7902.tar.gz bcm5719-llvm-b3ec43d78aa2599e1592392844a7ec638fab7902.zip |
Fix PR23293 - Do not unlock shared state before notifying consumers.
Within the shared state methods do not unlock the lock guards manually. This
could cause a race condition where the shared state is destroyed before the
method is complete.
llvm-svn: 239577
Diffstat (limited to 'libcxx/src')
-rw-r--r-- | libcxx/src/future.cpp | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/libcxx/src/future.cpp b/libcxx/src/future.cpp index 0c5c2c4488d..3132b1861af 100644 --- a/libcxx/src/future.cpp +++ b/libcxx/src/future.cpp @@ -98,7 +98,6 @@ __assoc_sub_state::set_value() #endif __state_ |= __constructed | ready; __cv_.notify_all(); - __lk.unlock(); } void @@ -111,7 +110,6 @@ __assoc_sub_state::set_value_at_thread_exit() #endif __state_ |= __constructed; __thread_local_data()->__make_ready_at_thread_exit(this); - __lk.unlock(); } void @@ -124,7 +122,6 @@ __assoc_sub_state::set_exception(exception_ptr __p) #endif __exception_ = __p; __state_ |= ready; - __lk.unlock(); __cv_.notify_all(); } @@ -138,7 +135,6 @@ __assoc_sub_state::set_exception_at_thread_exit(exception_ptr __p) #endif __exception_ = __p; __thread_local_data()->__make_ready_at_thread_exit(this); - __lk.unlock(); } void @@ -146,7 +142,6 @@ __assoc_sub_state::__make_ready() { unique_lock<mutex> __lk(__mut_); __state_ |= ready; - __lk.unlock(); __cv_.notify_all(); } |