gcc/libstdc++-v3/include
Jonathan Wakely 1fba0606b8 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
2018-07-25 11:40:12 +01:00
..
backward P0935R0 Eradicating unnecessarily explicit default constructors 2018-06-14 15:12:24 +01:00
bits Move std::unique_lock definition to a separate header 2018-07-25 11:40:12 +01:00
c Update copyright years. 2018-01-03 11:03:58 +01:00
c_compatibility Update copyright years. 2018-01-03 11:03:58 +01:00
c_global PR libstdc++/85729 add linkage specifications to headers 2018-05-10 13:35:45 +01:00
c_std Update copyright years. 2018-01-03 11:03:58 +01:00
debug functions.h (__gnu_debug::__check_string): Move... 2018-07-06 17:02:33 +00:00
decimal Update copyright years. 2018-01-03 11:03:58 +01:00
experimental Make __resource_adaptor_imp usable with C++17 memory_resource 2018-07-24 14:03:20 +01:00
ext LWG 3035. std::allocator's constructors should be constexpr 2018-06-18 16:47:07 +01:00
parallel Update copyright years. 2018-01-03 11:03:58 +01:00
precompiled Add initial version of C++17 <memory_resource> header 2018-07-24 22:09:55 +01:00
profile Update copyright years. 2018-01-03 11:03:58 +01:00
std Move std::unique_lock definition to a separate header 2018-07-25 11:40:12 +01:00
tr1 PR libstdc++/83140 - assoc_legendre returns negated value when m is odd 2018-05-10 13:59:52 +00:00
tr2 Update copyright years. 2018-01-03 11:03:58 +01:00
Makefile.am Move std::unique_lock definition to a separate header 2018-07-25 11:40:12 +01:00
Makefile.in Move std::unique_lock definition to a separate header 2018-07-25 11:40:12 +01:00