MCPcopy Create free account
hub / github.com/OpenZWave/open-zwave / Start

Method Start

cpp/src/platform/winRT/ThreadImpl.cpp:77–106  ·  view source on GitHub ↗

----------------------------------------------------------------------------- Start a function running on this thread -----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

75// Start a function running on this thread
76//-----------------------------------------------------------------------------
77bool ThreadImpl::Start
78(
79 Thread::pfnThreadProc_t _pfnThreadProc,
80 Event* _exitEvent,
81 void* _context
82)
83{
84 // Create a thread to run the specified function
85 m_pfnThreadProc = _pfnThreadProc;
86 m_context = _context;
87 m_exitEvent = _exitEvent;
88 m_exitEvent->Reset();
89
90 create_task([this]()
91 {
92 m_bIsRunning = true;
93 try
94 {
95 m_pfnThreadProc(m_exitEvent, m_context);
96 }
97 catch (Platform::Exception^)
98 {
99 }
100
101 m_bIsRunning = false;
102 // Let any watchers know that the thread has finished running.
103 m_owner->Notify();
104 });
105 return true;
106}
107
108//-----------------------------------------------------------------------------
109// <ThreadImpl::Sleep>

Callers

nothing calls this directly

Calls 2

ResetMethod · 0.45
NotifyMethod · 0.45

Tested by

no test coverage detected