diff options
author | 2018-09-11 18:18:58 +0000 | |
---|---|---|
committer | 2018-09-11 18:18:58 +0000 | |
commit | 820e1f31efc1d6ed04795ba2e79f3044e1907492 (patch) | |
tree | 815cebb3734784074b661935c33f00bd5eb4d862 /lib/libcxx/src/condition_variable.cpp | |
parent | Nuke unused LIST() ieee80211com_head. (diff) | |
download | wireguard-openbsd-820e1f31efc1d6ed04795ba2e79f3044e1907492.tar.xz wireguard-openbsd-820e1f31efc1d6ed04795ba2e79f3044e1907492.zip |
import of libc++ 6.0.0
Diffstat (limited to 'lib/libcxx/src/condition_variable.cpp')
-rw-r--r-- | lib/libcxx/src/condition_variable.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/libcxx/src/condition_variable.cpp b/lib/libcxx/src/condition_variable.cpp index bfb4bf3925f..2200aefb804 100644 --- a/lib/libcxx/src/condition_variable.cpp +++ b/lib/libcxx/src/condition_variable.cpp @@ -14,7 +14,7 @@ #include "condition_variable" #include "thread" #include "system_error" -#include "cassert" +#include "__undef_macros" _LIBCPP_BEGIN_NAMESPACE_STD @@ -79,6 +79,12 @@ condition_variable::__do_timed_wait(unique_lock<mutex>& lk, void notify_all_at_thread_exit(condition_variable& cond, unique_lock<mutex> lk) { + auto& tl_ptr = __thread_local_data(); + // If this thread was not created using std::thread then it will not have + // previously allocated. + if (tl_ptr.get() == nullptr) { + tl_ptr.set_pointer(new __thread_struct); + } __thread_local_data()->notify_all_at_thread_exit(&cond, lk.release()); } |