MCPcopy Create free account
hub / github.com/CobaltFusion/DebugViewPP / thread

Class thread

include/CobaltFusion/thread.h:15–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13namespace fusion {
14
15class thread : private std::thread
16{
17public:
18 thread(std::function<void()> fn) : std::thread(fn)
19 {
20 }
21
22 ~thread()
23 {
24 assert(!joinable() && "Always join the thread before releasing it");
25 }
26
27 void join()
28 {
29 if (joinable()) std::thread::join();
30 }
31
32 void detach()
33 {
34 assert(!joinable() && "Cannot detach an unjoinable thread");
35 std::thread::detach();
36 }
37
38 id get_id() const
39 {
40 std::thread::get_id();
41 }
42};
43
44} // namespace fusion

Callers 1

FileWriterMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected