MCPcopy Create free account
hub / github.com/HelenOS/helenos / thread

Method thread

uspace/lib/cpp/include/__bits/thread/thread.hpp:137–154  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

135 // TODO: check the remark in the standard
136 template<class F, class... Args>
137 explicit thread(F&& f, Args&&... args)
138 : id_{}
139 {
140 auto callable = [=](){
141 return f(forward<Args>(args)...);
142 };
143
144 auto callable_wrapper = new aux::callable_wrapper<decltype(callable)>{move(callable)};
145 joinable_wrapper_ = static_cast<aux::joinable_wrapper*>(callable_wrapper);
146
147 id_ = aux::threading::thread::create(
148 aux::thread_main<decltype(callable_wrapper)>,
149 *callable_wrapper
150 );
151
152 aux::threading::thread::start(id_);
153 // TODO: fibrils are weird here, 2 returns with same thread ids
154 }
155
156 thread(const thread&) = delete;
157 thread& operator=(const thread&) = delete;

Callers

nothing calls this directly

Calls 2

moveFunction · 0.85
createFunction · 0.85

Tested by

no test coverage detected