----------------------------------------------------------------------------- Stop a function running on this thread -----------------------------------------------------------------------------
| 83 | // Stop a function running on this thread |
| 84 | //----------------------------------------------------------------------------- |
| 85 | bool Thread::Stop |
| 86 | ( |
| 87 | ) |
| 88 | { |
| 89 | int32 timeout = 2000; // Give the thread 2 seconds to exit |
| 90 | m_exitEvent->Set(); |
| 91 | |
| 92 | if( Wait::Single( this, timeout ) < 0 ) |
| 93 | { |
| 94 | // Timed out |
| 95 | m_pImpl->Terminate(); |
| 96 | return false; |
| 97 | } |
| 98 | |
| 99 | return true; |
| 100 | } |
| 101 | |
| 102 | //----------------------------------------------------------------------------- |
| 103 | // <Thread::Sleep> |