[rtsan] Remove mkfifoat interceptor (#116997)
[llvm-project.git] / libcxx / include / __cxx03 / thread
blobf6d9cc8096a74f5841a316f962d8c757bfc07111
1 // -*- C++ -*-
2 //===----------------------------------------------------------------------===//
3 //
4 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5 // See https://llvm.org/LICENSE.txt for license information.
6 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //
8 //===----------------------------------------------------------------------===//
10 #ifndef _LIBCPP_THREAD
11 #define _LIBCPP_THREAD
15     thread synopsis
17 namespace std
20 class thread
22 public:
23     class id;
24     typedef pthread_t native_handle_type;
26     thread() noexcept;
27     template <class F, class ...Args> explicit thread(F&& f, Args&&... args);
28     ~thread();
30     thread(const thread&) = delete;
31     thread(thread&& t) noexcept;
33     thread& operator=(const thread&) = delete;
34     thread& operator=(thread&& t) noexcept;
36     void swap(thread& t) noexcept;
38     bool joinable() const noexcept;
39     void join();
40     void detach();
41     id get_id() const noexcept;
42     native_handle_type native_handle();
44     static unsigned hardware_concurrency() noexcept;
47 void swap(thread& x, thread& y) noexcept;
49 class thread::id
51 public:
52     id() noexcept;
55 bool operator==(thread::id x, thread::id y) noexcept;
56 bool operator!=(thread::id x, thread::id y) noexcept;             // removed in C++20
57 bool operator< (thread::id x, thread::id y) noexcept;             // removed in C++20
58 bool operator<=(thread::id x, thread::id y) noexcept;             // removed in C++20
59 bool operator> (thread::id x, thread::id y) noexcept;             // removed in C++20
60 bool operator>=(thread::id x, thread::id y) noexcept;             // removed in C++20
61 strong_ordering operator<=>(thread::id x, thread::id y) noexcept; // C++20
63 template<class charT, class traits>
64 basic_ostream<charT, traits>&
65 operator<<(basic_ostream<charT, traits>& out, thread::id id);
67 template<class charT>
68 struct formatter<thread::id, charT>;
70 namespace this_thread
73 thread::id get_id() noexcept;
75 void yield() noexcept;
77 template <class Clock, class Duration>
78 void sleep_until(const chrono::time_point<Clock, Duration>& abs_time);
80 template <class Rep, class Period>
81 void sleep_for(const chrono::duration<Rep, Period>& rel_time);
83 }  // this_thread
85 }  // std
89 #include <__cxx03/__config>
91 #if !defined(_LIBCPP_HAS_NO_THREADS)
93 #  include <__cxx03/__thread/formatter.h>
94 #  include <__cxx03/__thread/jthread.h>
95 #  include <__cxx03/__thread/support.h>
96 #  include <__cxx03/__thread/this_thread.h>
97 #  include <__cxx03/__thread/thread.h>
98 #  include <__cxx03/version>
100 // standard-mandated includes
102 // [thread.syn]
103 #  include <__cxx03/compare>
105 #  if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
106 #    pragma GCC system_header
107 #  endif
109 #endif // !defined(_LIBCPP_HAS_NO_THREADS)
111 #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
112 #  include <__cxx03/cstddef>
113 #  include <__cxx03/ctime>
114 #  include <__cxx03/iosfwd>
115 #  include <__cxx03/ratio>
116 #endif
118 #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 17
119 #  include <__cxx03/chrono>
120 #endif
122 #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
123 #  include <__cxx03/cstring>
124 #  include <__cxx03/functional>
125 #  include <__cxx03/new>
126 #  include <__cxx03/system_error>
127 #  include <__cxx03/type_traits>
128 #endif
130 #endif // _LIBCPP_THREAD