diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-01-02 19:18:58 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-01-02 19:18:58 +0000 |
commit | 53a420fba21cf1644972b34dcd811a43cdb8368d (patch) | |
tree | 66a19f6f8b65215772549a51d688492ab8addc0d /src/condition_variable.cpp | |
parent | b50f1549701eb950921e5d6f2e55ba1a1dadbb43 (diff) |
Notes
Diffstat (limited to 'src/condition_variable.cpp')
-rw-r--r-- | src/condition_variable.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/condition_variable.cpp b/src/condition_variable.cpp index bfb4bf3925f7e..25e66038eec0b 100644 --- a/src/condition_variable.cpp +++ b/src/condition_variable.cpp @@ -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()); } |