1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | namespace std{ struct thread{ // native_handle_type 是连接 thread 类和操作系统 SDK API 之间的桥梁。 typedef implementation-dependent native_handle_type; native_handle_type native_handle(); // struct id{ id() noexcept; // 可以由==, < 两个运算衍生出其它大小关系运算。 bool operator==(thread::id x, thread::id y) noexcept; bool operator<(thread::id x, thread::id y) noexcept; template<class charT, class traits> basic_ostream<charT, traits>& operator<<(basic_ostream<charT, traits>&out, thread::id id); // 哈希函数 template <class T> struct hash; template <> struct hash<thread::id>; }; id get_id() const noexcept; // 构造与析构 thread() noexcept; template<class F, class… Args> explicit thread(F&f, Args&&… args); ~thread(); thread(const thread&) = delete; thread(thread&&) noexcept; thread& operator=( const thread&) = delete; thread& operator=(thread&&) noexcept; // void swap(thread&) noexcept; bool joinable() const noexcept; void join(); void detach(); // 获取物理线程数目 static unsigned hardware_concurrency() noexcept; } namespace this_thead{ thread::id get_id(); void yield(); template<class Clock, class Duration> void sleep_until(const chrono::time_point<Clock, Duration>& abs_time); template<class Rep, class Period> void sleep_for(const chromo::duration<Rep, Period>& rel_time); } } |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |