----------------------------------------------------------------------------- End this thread -----------------------------------------------------------------------------
| 104 | // End this thread |
| 105 | //----------------------------------------------------------------------------- |
| 106 | bool 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> |