Back to home page

EIC code displayed by LXR

 
 

    


Warning, /include/c++/v1/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_THREAD
0011 #define _LIBCPP_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 #if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
0090 #  include <__cxx03/thread>
0091 #else
0092 #  include <__config>
0093 
0094 #  if _LIBCPP_HAS_THREADS
0095 
0096 #    include <__thread/this_thread.h>
0097 #    include <__thread/thread.h>
0098 
0099 #    if _LIBCPP_STD_VER >= 20
0100 #      include <__thread/jthread.h>
0101 #    endif
0102 
0103 #    if _LIBCPP_STD_VER >= 23
0104 #      include <__thread/formatter.h>
0105 #    endif
0106 
0107 #    include <version>
0108 
0109 // standard-mandated includes
0110 
0111 // [thread.syn]
0112 #    include <compare>
0113 
0114 #    if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
0115 #      pragma GCC system_header
0116 #    endif
0117 
0118 #  endif // _LIBCPP_HAS_THREADS
0119 
0120 #  if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 17
0121 #    include <chrono>
0122 #  endif
0123 
0124 #  if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
0125 #    include <cstring>
0126 #    include <functional>
0127 #    include <new>
0128 #    include <system_error>
0129 #    include <type_traits>
0130 #  endif
0131 #endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
0132 
0133 #endif // _LIBCPP_THREAD