| 52 | } |
| 53 | |
| 54 | void thread::detach() { |
| 55 | int ec = EINVAL; |
| 56 | if (!__libcpp_thread_isnull(&__t_)) { |
| 57 | ec = __libcpp_thread_detach(&__t_); |
| 58 | if (ec == 0) |
| 59 | __t_ = _LIBCPP_NULL_THREAD; |
| 60 | } |
| 61 | |
| 62 | if (ec) |
| 63 | std::__throw_system_error(ec, "thread::detach failed"); |
| 64 | } |
| 65 | |
| 66 | unsigned thread::hardware_concurrency() noexcept { |
| 67 | #if defined(_SC_NPROCESSORS_ONLN) |