aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Chemeris <Alexander.Chemeris@gmail.com>2013-07-14 12:04:44 +0400
committerAlexander Chemeris <Alexander.Chemeris@gmail.com>2013-07-14 23:11:54 +0400
commit302a9198df85e4f771368f24d8445dec7c8b2203 (patch)
tree36a9663d4cdfc7588768f6e8cee4ce93d38d12c8
parentd4a8c1360e5d54188b648766dde199fa37f2ed27 (diff)
CommonLibs: Signal::wait() should return the value which pthread_cond_timedwait() returns.
-rw-r--r--CommonLibs/Threads.cpp4
-rw-r--r--CommonLibs/Threads.h6
2 files changed, 5 insertions, 5 deletions
diff --git a/CommonLibs/Threads.cpp b/CommonLibs/Threads.cpp
index de6520b..dce7eda 100644
--- a/CommonLibs/Threads.cpp
+++ b/CommonLibs/Threads.cpp
@@ -95,11 +95,11 @@ Mutex::~Mutex()
/** Block for the signal up to the cancellation timeout. */
-void Signal::wait(Mutex& wMutex, unsigned timeout) const
+int Signal::wait(Mutex& wMutex, unsigned timeout) const
{
Timeval then(timeout);
struct timespec waitTime = then.timespec();
- pthread_cond_timedwait(&mSignal,&wMutex.mMutex,&waitTime);
+ return pthread_cond_timedwait(&mSignal,&wMutex.mMutex,&waitTime);
}
diff --git a/CommonLibs/Threads.h b/CommonLibs/Threads.h
index a38a73a..0d21e41 100644
--- a/CommonLibs/Threads.h
+++ b/CommonLibs/Threads.h
@@ -121,14 +121,14 @@ class Signal {
Block for the signal up to the cancellation timeout.
Under Linux, spurious returns are possible.
*/
- void wait(Mutex& wMutex, unsigned timeout) const;
+ int wait(Mutex& wMutex, unsigned timeout) const;
/**
Block for the signal.
Under Linux, spurious returns are possible.
*/
- void wait(Mutex& wMutex) const
- { pthread_cond_wait(&mSignal,&wMutex.mMutex); }
+ int wait(Mutex& wMutex) const
+ { return pthread_cond_wait(&mSignal,&wMutex.mMutex); }
void signal() { pthread_cond_signal(&mSignal); }