----------------------------------------------------------------------------- Start a function running on this thread -----------------------------------------------------------------------------
| 65 | // Start a function running on this thread |
| 66 | //----------------------------------------------------------------------------- |
| 67 | bool ThreadImpl::Start |
| 68 | ( |
| 69 | Thread::pfnThreadProc_t _pfnThreadProc, |
| 70 | Event* _exitEvent, |
| 71 | void* _context |
| 72 | ) |
| 73 | { |
| 74 | // Create a thread to run the specified function |
| 75 | m_pfnThreadProc = _pfnThreadProc; |
| 76 | m_context = _context; |
| 77 | m_exitEvent = _exitEvent; |
| 78 | m_exitEvent->Reset(); |
| 79 | |
| 80 | HANDLE hThread = ::CreateThread( NULL, 0, ThreadImpl::ThreadProc, this, CREATE_SUSPENDED, NULL ); |
| 81 | m_hThread = hThread; |
| 82 | |
| 83 | ::ResumeThread( hThread ); |
| 84 | return true; |
| 85 | } |
| 86 | |
| 87 | //----------------------------------------------------------------------------- |
| 88 | // <ThreadImpl::Sleep> |