aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/include/std/condition_variable
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2018-07-25 11:40:12 +0100
committerJonathan Wakely <redi@gcc.gnu.org>2018-07-25 11:40:12 +0100
commit1fba0606b813ab0925e7fc9ee92c9b57c7c3b94f (patch)
tree533771db472d612b364ad1252a9002ff46e0abdc /libstdc++-v3/include/std/condition_variable
parent1978cc78c86a82055f1981569f8383770c825e70 (diff)
downloadgcc-1fba0606b813ab0925e7fc9ee92c9b57c7c3b94f.zip
gcc-1fba0606b813ab0925e7fc9ee92c9b57c7c3b94f.tar.gz
gcc-1fba0606b813ab0925e7fc9ee92c9b57c7c3b94f.tar.bz2
Move std::unique_lock definition to a separate header
This will allow std::mutex and std::lock_guard to be used elsewhere in the library without pulling in the whole of <chrono>. Previously the whole of <bits/std_mutex.h> was conditional on the _GLIBCXX_USE_C99_STDINT_TR1 macro, but only the std::unique_lock members that use <chrono> facilities should depend on that. std::mutex only needs to depend on _GLIBCXX_HAS_GTHREADS and std::lock_guard can be defined unconditionally. Some parts of <bits/std_mutex.h> and <mutex> are based on code in <ext/concurrence.h> which dates from 2003. However, the std::unique_lock implementation was added in 2008 by r135007, without using any earlier code. Therefore the new header file has copyright years 2008-2018. * include/Makefile.am: Add new <bits/unique_lock.h> header. * include/Makefile.in: Regenerate. * include/bits/std_mutex.h [!_GLIBCXX_USE_C99_STDINT_TR1] (mutex) (lock_guard): Define independent of _GLIBCXX_USE_C99_STDINT_TR1. (unique_lock): Move definition to ... * include/bits/unique_lock.h: New header. [!_GLIBCXX_USE_C99_STDINT_TR1] (unique_lock): Define unconditionally. [_GLIBCXX_USE_C99_STDINT_TR1] (unique_lock(mutex_type&, time_point)) (unique_lock(mutex_type&, duration), unique_lock::try_lock_until) (unique_lock::try_lock_for): Define only when <chrono> is usable. * include/std/condition_variable: Include <bits/unique_lock.h>. * include/std/mutex: Likewise. From-SVN: r262963
Diffstat (limited to 'libstdc++-v3/include/std/condition_variable')
-rw-r--r--libstdc++-v3/include/std/condition_variable1
1 files changed, 1 insertions, 0 deletions
diff --git a/libstdc++-v3/include/std/condition_variable b/libstdc++-v3/include/std/condition_variable
index 84863a1..88ab775 100644
--- a/libstdc++-v3/include/std/condition_variable
+++ b/libstdc++-v3/include/std/condition_variable
@@ -37,6 +37,7 @@
#include <chrono>
#include <bits/std_mutex.h>
+#include <bits/unique_lock.h>
#include <ext/concurrence.h>
#include <bits/alloc_traits.h>
#include <bits/allocator.h>