Warning, /include/c++/v1/__cxx03/thread is written in an unsupported language. File is not indexed.
0001 // -*- C++ -*-
0002 //===----------------------------------------------------------------------===//
0003 //
0004 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0005 // See https://llvm.org/LICENSE.txt for license information.
0006 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0007 //
0008 //===----------------------------------------------------------------------===//
0009
0010 #ifndef _LIBCPP___CXX03_THREAD
0011 #define _LIBCPP___CXX03_THREAD
0012
0013 /*
0014
0015 thread synopsis
0016
0017 namespace std
0018 {
0019
0020 class thread
0021 {
0022 public:
0023 class id;
0024 typedef pthread_t native_handle_type;
0025
0026 thread() noexcept;
0027 template <class F, class ...Args> explicit thread(F&& f, Args&&... args);
0028 ~thread();
0029
0030 thread(const thread&) = delete;
0031 thread(thread&& t) noexcept;
0032
0033 thread& operator=(const thread&) = delete;
0034 thread& operator=(thread&& t) noexcept;
0035
0036 void swap(thread& t) noexcept;
0037
0038 bool joinable() const noexcept;
0039 void join();
0040 void detach();
0041 id get_id() const noexcept;
0042 native_handle_type native_handle();
0043
0044 static unsigned hardware_concurrency() noexcept;
0045 };
0046
0047 void swap(thread& x, thread& y) noexcept;
0048
0049 class thread::id
0050 {
0051 public:
0052 id() noexcept;
0053 };
0054
0055 bool operator==(thread::id x, thread::id y) noexcept;
0056 bool operator!=(thread::id x, thread::id y) noexcept; // removed in C++20
0057 bool operator< (thread::id x, thread::id y) noexcept; // removed in C++20
0058 bool operator<=(thread::id x, thread::id y) noexcept; // removed in C++20
0059 bool operator> (thread::id x, thread::id y) noexcept; // removed in C++20
0060 bool operator>=(thread::id x, thread::id y) noexcept; // removed in C++20
0061 strong_ordering operator<=>(thread::id x, thread::id y) noexcept; // C++20
0062
0063 template<class charT, class traits>
0064 basic_ostream<charT, traits>&
0065 operator<<(basic_ostream<charT, traits>& out, thread::id id);
0066
0067 template<class charT>
0068 struct formatter<thread::id, charT>;
0069
0070 namespace this_thread
0071 {
0072
0073 thread::id get_id() noexcept;
0074
0075 void yield() noexcept;
0076
0077 template <class Clock, class Duration>
0078 void sleep_until(const chrono::time_point<Clock, Duration>& abs_time);
0079
0080 template <class Rep, class Period>
0081 void sleep_for(const chrono::duration<Rep, Period>& rel_time);
0082
0083 } // this_thread
0084
0085 } // std
0086
0087 */
0088
0089 #include <__cxx03/__config>
0090
0091 #if !defined(_LIBCPP_HAS_NO_THREADS)
0092
0093 # include <__cxx03/__thread/formatter.h>
0094 # include <__cxx03/__thread/jthread.h>
0095 # include <__cxx03/__thread/support.h>
0096 # include <__cxx03/__thread/this_thread.h>
0097 # include <__cxx03/__thread/thread.h>
0098 # include <__cxx03/version>
0099
0100 // standard-mandated includes
0101
0102 // [thread.syn]
0103 # include <__cxx03/compare>
0104
0105 # if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
0106 # pragma GCC system_header
0107 # endif
0108
0109 #endif // !defined(_LIBCPP_HAS_NO_THREADS)
0110
0111 #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
0112 # include <__cxx03/cstddef>
0113 # include <__cxx03/ctime>
0114 # include <__cxx03/iosfwd>
0115 # include <__cxx03/ratio>
0116 #endif
0117
0118 #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 17
0119 # include <__cxx03/chrono>
0120 #endif
0121
0122 #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
0123 # include <__cxx03/cstring>
0124 # include <__cxx03/functional>
0125 # include <__cxx03/new>
0126 # include <__cxx03/system_error>
0127 # include <__cxx03/type_traits>
0128 #endif
0129
0130 #endif // _LIBCPP___CXX03_THREAD