diff --git a/src/lib/utils/thread.cpp b/src/lib/utils/thread.cpp index 6db1ce00..737087bf 100755 --- a/src/lib/utils/thread.cpp +++ b/src/lib/utils/thread.cpp @@ -94,6 +94,9 @@ bool WaitThread::join() { } bool WaitThread::Wait(int seconds, int millis) { + if (!isRunning()) { + return false; + } pthread_mutex_lock(&m_mutex); struct timespec t; clockGettime(&t); @@ -123,6 +126,9 @@ void NotifiableThread::notify() { } bool NotifiableThread::waitNotified(int millis) { + if (!isRunning()) { + return false; + } pthread_mutex_lock(&m_mutex); if (!m_notified) { struct timespec t;