MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / start_thread

Method start_thread

components/libc/cplusplus/cpp11/gcc/thread.cpp:34–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls 3

pthread_createFunction · 0.85
throw_system_errorFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected