| 32 | } |
| 33 | |
| 34 | void thread::start_thread(invoker_base_ptr b) |
| 35 | { |
| 36 | auto raw_ptr = b.get(); |
| 37 | // transfer the ownership of the invoker to the new thread |
| 38 | raw_ptr->this_ptr = std::move(b); |
| 39 | int err = pthread_create(&_m_thr.__cpp_thread_t, NULL, |
| 40 | &execute_native_thread_routine, raw_ptr); |
| 41 | |
| 42 | if (err) |
| 43 | { |
| 44 | raw_ptr->this_ptr.reset(); |
| 45 | throw_system_error(err, "Failed to create a thread"); |
| 46 | } |
| 47 | |
| 48 | } |
| 49 | |
| 50 | thread::~thread() |
| 51 | { |
nothing calls this directly
no test coverage detected