MCPcopy Create free account
hub / github.com/comaps/comaps / Create

Method Create

libs/base/thread.cpp:50–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48}
49
50bool Thread::Create(std::unique_ptr<IRoutine> && routine)
51{
52 ASSERT(!m_routine, ("Current implementation doesn't allow to reuse thread"));
53 std::thread routineThread;
54 try
55 {
56 m_routine.reset(routine.release());
57 routineThread = std::thread(&RunRoutine, m_routine);
58 }
59 catch (std::exception & e)
60 {
61 LOG(LERROR, ("Thread creation failed with error:", e.what()));
62 m_routine.reset();
63 return false;
64 }
65 m_thread = std::move(routineThread);
66 return true;
67}
68
69void Thread::Cancel()
70{

Callers 4

RenderMethod · 0.45
ImplMethod · 0.45
UNIT_TESTFunction · 0.45
UNIT_TESTFunction · 0.45

Calls 4

ASSERTFunction · 0.85
resetMethod · 0.45
releaseMethod · 0.45
whatMethod · 0.45

Tested by 2

UNIT_TESTFunction · 0.36
UNIT_TESTFunction · 0.36