dont wait when not running

This commit is contained in:
John
2023-10-14 09:05:25 +02:00
parent 8b302de3ac
commit 7198a1f015
+6
View File
@@ -94,6 +94,9 @@ bool WaitThread::join() {
} }
bool WaitThread::Wait(int seconds, int millis) { bool WaitThread::Wait(int seconds, int millis) {
if (!isRunning()) {
return false;
}
pthread_mutex_lock(&m_mutex); pthread_mutex_lock(&m_mutex);
struct timespec t; struct timespec t;
clockGettime(&t); clockGettime(&t);
@@ -123,6 +126,9 @@ void NotifiableThread::notify() {
} }
bool NotifiableThread::waitNotified(int millis) { bool NotifiableThread::waitNotified(int millis) {
if (!isRunning()) {
return false;
}
pthread_mutex_lock(&m_mutex); pthread_mutex_lock(&m_mutex);
if (!m_notified) { if (!m_notified) {
struct timespec t; struct timespec t;