| 48 | namespace std |
| 49 | { |
| 50 | void thread::_M_start_thread(__shared_base_type __b) |
| 51 | { |
| 52 | if (!__gthread_active_p()) |
| 53 | #if __EXCEPTIONS |
| 54 | throw system_error(make_error_code(errc::operation_not_permitted), |
| 55 | "Enable multithreading to use std::thread"); |
| 56 | #else |
| 57 | __throw_system_error(int(errc::operation_not_permitted)); |
| 58 | #endif |
| 59 | |
| 60 | __b->_M_this_ptr = __b; |
| 61 | int __e = __gthread_create(&_M_id._M_thread, _v_execute_native_thread_routine, |
| 62 | __b.get()); |
| 63 | if (__e) { |
| 64 | __b->_M_this_ptr.reset(); |
| 65 | __throw_system_error(__e); |
| 66 | } |
| 67 | } |
| 68 | } |
| 69 | #endif |