Index: src/ch/ClipboardMonitor.cpp =================================================================== diff -u -N -r92410cc8f6de1e1696774cb25cb37464c4e74cbd -r44c811ed2e152c83d92aa7d0b41497a90a177209 --- src/ch/ClipboardMonitor.cpp (.../ClipboardMonitor.cpp) (revision 92410cc8f6de1e1696774cb25cb37464c4e74cbd) +++ src/ch/ClipboardMonitor.cpp (.../ClipboardMonitor.cpp) (revision 44c811ed2e152c83d92aa7d0b41497a90a177209) @@ -276,7 +276,7 @@ // sleep for some time const int iSleepCount=200; - if(pData->m_threadWorker.KillRequested()) + if(pData->m_threadWorker.KillRequested(iSleepCount)) break; uiCounter+=iSleepCount; Index: src/ch/TWorkerThreadController.cpp =================================================================== diff -u -N -r1402c0dd569ff5f381835966227f5b2836a755d6 -r44c811ed2e152c83d92aa7d0b41497a90a177209 --- src/ch/TWorkerThreadController.cpp (.../TWorkerThreadController.cpp) (revision 1402c0dd569ff5f381835966227f5b2836a755d6) +++ src/ch/TWorkerThreadController.cpp (.../TWorkerThreadController.cpp) (revision 44c811ed2e152c83d92aa7d0b41497a90a177209) @@ -135,14 +135,14 @@ } } -bool TWorkerThreadController::KillRequested() +bool TWorkerThreadController::KillRequested(DWORD dwWaitForSignal) { // this method does not have any mutexes, because it should be only called from within the thread // being controlled by this object. This implies that the thread is alive and running, // this class must exist because it should not be possible for the thread to exist and be active // when this object is out of scope, and so the m_hKillThread should be non-NULL, since it is being destroyed // in destructor. - return (m_hKillThread && WaitForSingleObject(m_hKillThread, 0) == WAIT_OBJECT_0); + return (m_hKillThread && WaitForSingleObject(m_hKillThread, dwWaitForSignal) == WAIT_OBJECT_0); } void TWorkerThreadController::RemoveZombieData(boost::upgrade_lock& rUpgradeLock) Index: src/ch/TWorkerThreadController.h =================================================================== diff -u -N -r1402c0dd569ff5f381835966227f5b2836a755d6 -r44c811ed2e152c83d92aa7d0b41497a90a177209 --- src/ch/TWorkerThreadController.h (.../TWorkerThreadController.h) (revision 1402c0dd569ff5f381835966227f5b2836a755d6) +++ src/ch/TWorkerThreadController.h (.../TWorkerThreadController.h) (revision 44c811ed2e152c83d92aa7d0b41497a90a177209) @@ -41,7 +41,7 @@ void ChangePriority(int iPriority); // methods to be used only inside the thread being controlled - bool KillRequested(); + bool KillRequested(DWORD dwWaitForSignal = 0); protected: void RemoveZombieData(boost::upgrade_lock& rUpgradeLock);