| 40 | } |
| 41 | |
| 42 | void thread::join() { |
| 43 | int ec = EINVAL; |
| 44 | if (!__libcpp_thread_isnull(&__t_)) { |
| 45 | ec = __libcpp_thread_join(&__t_); |
| 46 | if (ec == 0) |
| 47 | __t_ = _LIBCPP_NULL_THREAD; |
| 48 | } |
| 49 | |
| 50 | if (ec) |
| 51 | std::__throw_system_error(ec, "thread::join failed"); |
| 52 | } |
| 53 | |
| 54 | void thread::detach() { |
| 55 | int ec = EINVAL; |