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

Method Terminate

cpp/src/platform/unix/ThreadImpl.cpp:106–129  ·  view source on GitHub ↗

----------------------------------------------------------------------------- End this thread -----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

104// End this thread
105//-----------------------------------------------------------------------------
106bool ThreadImpl::Terminate
107(
108)
109{
110 void* data = NULL;
111
112 //fprintf(stderr, "thread %s stopping %08x running %d\n", m_name.c_str(), m_hThread, m_bIsRunning );
113 //fflush(stderr);
114 if( !m_bIsRunning )
115 {
116 return false;
117 }
118
119 // This will kill an app that doesn't catch and ignore it.
120 // We need to find another way to interrupt select.
121 // thread_kill( m_hThread, SIGALRM );
122
123 //m_hThread = NULL;
124 m_bIsRunning = false;
125 pthread_cancel( m_hThread );
126 pthread_join( m_hThread, &data );
127
128 return true;
129}
130
131//-----------------------------------------------------------------------------
132// <ThreadImpl::msSleep>

Callers 1

StopMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected