diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/thread/qwaitcondition_unix.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/corelib/thread/qwaitcondition_unix.cpp b/src/corelib/thread/qwaitcondition_unix.cpp index e3f8b2fff3..59c4035232 100644 --- a/src/corelib/thread/qwaitcondition_unix.cpp +++ b/src/corelib/thread/qwaitcondition_unix.cpp @@ -104,14 +104,19 @@ public: int waiters; int wakeups; + int wait_relative(unsigned long time) + { + timespec ti; + qt_abstime_for_timeout(&ti, time); + return pthread_cond_timedwait(&cond, &mutex, &ti); + } + bool wait(unsigned long time) { int code; forever { if (time != ULONG_MAX) { - timespec ti; - qt_abstime_for_timeout(&ti, time); - code = pthread_cond_timedwait(&cond, &mutex, &ti); + code = wait_relative(time); } else { code = pthread_cond_wait(&cond, &mutex); } |