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/include/future | |
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/include/future')
-rw-r--r-- | libcxx/include/future | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/libcxx/include/future b/libcxx/include/future index ad7af72b12f..1474ab0b072 100644 --- a/libcxx/include/future +++ b/libcxx/include/future @@ -651,7 +651,6 @@ __assoc_state<_Rp>::set_value(_Arg& __arg) #endif ::new(&__value_) _Rp(_VSTD::forward<_Arg>(__arg)); this->__state_ |= base::__constructed | base::ready; - __lk.unlock(); __cv_.notify_all(); } @@ -672,7 +671,6 @@ __assoc_state<_Rp>::set_value_at_thread_exit(_Arg& __arg) ::new(&__value_) _Rp(_VSTD::forward<_Arg>(__arg)); this->__state_ |= base::__constructed; __thread_local_data()->__make_ready_at_thread_exit(this); - __lk.unlock(); } template <class _Rp> @@ -733,7 +731,6 @@ __assoc_state<_Rp&>::set_value(_Rp& __arg) #endif __value_ = _VSTD::addressof(__arg); this->__state_ |= base::__constructed | base::ready; - __lk.unlock(); __cv_.notify_all(); } @@ -749,7 +746,6 @@ __assoc_state<_Rp&>::set_value_at_thread_exit(_Rp& __arg) __value_ = _VSTD::addressof(__arg); this->__state_ |= base::__constructed; __thread_local_data()->__make_ready_at_thread_exit(this); - __lk.unlock(); } template <class _Rp> |