/usr/include/c++/11
NameSizeModeActions
backward/-0755rm
bits/-0755rm
debug/-0755rm
decimal/-0755rm
experimental/-0755rm
ext/-0755rm
parallel/-0755rm
pstl/-0755rm
tr1/-0755rm
tr2/-0755rm
algorithm30450644editdlrm
any187580644editdlrm
array138200644editdlrm
atomic488000644editdlrm
barrier80260644editdlrm
bit121870644editdlrm
bitset459950644editdlrm
cassert16480644editdlrm
ccomplex13350644editdlrm
cctype24090644editdlrm
cerrno17700644editdlrm
cfenv20510644editdlrm
cfloat18890644editdlrm
charconv197610644editdlrm
chrono972120644editdlrm
cinttypes21570644editdlrm
ciso64614640644editdlrm
climits19130644editdlrm
clocale19050644editdlrm
cmath493820644editdlrm
codecvt52750644editdlrm
compare282710644editdlrm
complex567030644editdlrm
complex.h15960644editdlrm
concepts122300644editdlrm
condition_variable127800644editdlrm
coroutine91560644editdlrm
csetjmp19490644editdlrm
csignal18550644editdlrm
cstdalign14070644editdlrm
cstdarg18680644editdlrm
cstdbool14010644editdlrm
cstddef66900644editdlrm
cstdint23350644editdlrm
cstdio44390644editdlrm
cstdlib63250644editdlrm
cstring31560644editdlrm
ctgmath13600644editdlrm
ctime22980644editdlrm
cuchar22100644editdlrm
cwchar65420644editdlrm
cwctype27930644editdlrm
cxxabi.h222800644editdlrm
deque39730644editdlrm
exception50170644editdlrm
execution18030644editdlrm
fenv.h20200644editdlrm
filesystem16450644editdlrm
forward_list26900644editdlrm
fstream406800644editdlrm
functional402000644editdlrm
future522780644editdlrm
initializer_list30380644editdlrm
iomanip165470644editdlrm
ios16010644editdlrm
iosfwd75130644editdlrm
iostream26970644editdlrm
istream340980644editdlrm
iterator27510644editdlrm
latch27320644editdlrm
limits716740644editdlrm
list36570644editdlrm
locale14880644editdlrm
map39290644editdlrm
math.h45730644editdlrm
memory45130644editdlrm
memory_resource211130644editdlrm
mutex242230644editdlrm
new83490644editdlrm
numbers62440644editdlrm
numeric261100644editdlrm
optional401700644editdlrm
ostream259760644editdlrm
queue24670644editdlrm
random16920644editdlrm
ranges1072010644editdlrm
ratio201080644editdlrm
regex28610644editdlrm
scoped_allocator176490644editdlrm
semaphore30000644editdlrm
set37990644editdlrm
shared_mutex245880644editdlrm
source_location27470644editdlrm
span131310644editdlrm
sstream392310644editdlrm
stack23910644editdlrm
stdexcept98780644editdlrm
stdlib.h22480644editdlrm
stop_token159820644editdlrm
streambuf298900644editdlrm
string46450644editdlrm
string_view261570644editdlrm
syncstream83300644editdlrm
system_error150060644editdlrm
tgmath.h13600644editdlrm
thread59190644editdlrm
tuple627670644editdlrm
typeindex35120644editdlrm
typeinfo77460644editdlrm
type_traits1076670644editdlrm
unordered_map34670644editdlrm
unordered_set33400644editdlrm
utility148160644editdlrm
valarray406950644editdlrm
variant628660644editdlrm
vector42750644editdlrm
version92640644editdlrm
Edit: /usr/include/c++/11/thread (5919B)
// -*- C++ -*- // Copyright (C) 2008-2021 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file include/thread * This is a Standard C++ Library header. */ #ifndef _GLIBCXX_THREAD #define _GLIBCXX_THREAD 1 #pragma GCC system_header #if __cplusplus < 201103L # include #else #if __cplusplus > 201703L # include // std::strong_ordering # include // std::stop_source, std::stop_token, std::nostopstate #endif #include // std::thread, get_id, yield #include // std::this_thread::sleep_for, sleep_until namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION /** * @defgroup threads Threads * @ingroup concurrency * * Classes for thread support. * @{ */ // std::thread is defined in #if __cpp_lib_three_way_comparison inline strong_ordering operator<=>(thread::id __x, thread::id __y) noexcept { return __x._M_thread <=> __y._M_thread; } #else inline bool operator!=(thread::id __x, thread::id __y) noexcept { return !(__x == __y); } inline bool operator<(thread::id __x, thread::id __y) noexcept { // Pthreads doesn't define any way to do this, so we just have to // assume native_handle_type is LessThanComparable. return __x._M_thread < __y._M_thread; } inline bool operator<=(thread::id __x, thread::id __y) noexcept { return !(__y < __x); } inline bool operator>(thread::id __x, thread::id __y) noexcept { return __y < __x; } inline bool operator>=(thread::id __x, thread::id __y) noexcept { return !(__x < __y); } #endif // __cpp_lib_three_way_comparison template inline basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __out, thread::id __id) { if (__id == thread::id()) return __out << "thread::id of a non-executing thread"; else return __out << __id._M_thread; } #ifdef __cpp_lib_jthread /// A thread that can be requested to stop and automatically joined. class jthread { public: using id = thread::id; using native_handle_type = thread::native_handle_type; jthread() noexcept : _M_stop_source{nostopstate} { } template, jthread>>> explicit jthread(_Callable&& __f, _Args&&... __args) : _M_thread{_S_create(_M_stop_source, std::forward<_Callable>(__f), std::forward<_Args>(__args)...)} { } jthread(const jthread&) = delete; jthread(jthread&&) noexcept = default; ~jthread() { if (joinable()) { request_stop(); join(); } } jthread& operator=(const jthread&) = delete; jthread& operator=(jthread&& __other) noexcept { std::jthread(std::move(__other)).swap(*this); return *this; } void swap(jthread& __other) noexcept { std::swap(_M_stop_source, __other._M_stop_source); std::swap(_M_thread, __other._M_thread); } [[nodiscard]] bool joinable() const noexcept { return _M_thread.joinable(); } void join() { _M_thread.join(); } void detach() { _M_thread.detach(); } [[nodiscard]] id get_id() const noexcept { return _M_thread.get_id(); } [[nodiscard]] native_handle_type native_handle() { return _M_thread.native_handle(); } [[nodiscard]] static unsigned hardware_concurrency() noexcept { return thread::hardware_concurrency(); } [[nodiscard]] stop_source get_stop_source() noexcept { return _M_stop_source; } [[nodiscard]] stop_token get_stop_token() const noexcept { return _M_stop_source.get_token(); } bool request_stop() noexcept { return _M_stop_source.request_stop(); } friend void swap(jthread& __lhs, jthread& __rhs) noexcept { __lhs.swap(__rhs); } private: template static thread _S_create(stop_source& __ssrc, _Callable&& __f, _Args&&... __args) { if constexpr(is_invocable_v, stop_token, decay_t<_Args>...>) return thread{std::forward<_Callable>(__f), __ssrc.get_token(), std::forward<_Args>(__args)...}; else { static_assert(is_invocable_v, decay_t<_Args>...>, "std::thread arguments must be invocable after" " conversion to rvalues"); return thread{std::forward<_Callable>(__f), std::forward<_Args>(__args)...}; } } stop_source _M_stop_source; thread _M_thread; }; #endif // __cpp_lib_jthread /// @} group threads _GLIBCXX_END_NAMESPACE_VERSION } // namespace #endif // C++11 #endif // _GLIBCXX_THREAD