dont wait when not running
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user