diff options
author | Olivier Goffart <ogoffart@woboq.com> | 2012-11-15 18:16:30 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-11-16 01:37:01 +0100 |
commit | 2b308d4cb5cdf2f3374404c83dc0b193fcb78612 (patch) | |
tree | 176d133c971aa5a72e7ca0b3e86ae443ed4ba5d9 /src/corelib/thread | |
parent | 162926414d2586bdf32f7bc61860772d598beaeb (diff) |
Fix QMutex::tryLock timeout computation on Linux
The timeout is in millisecond. So we just need to divide by 1000 to get
the number of seconds
Regression introduced in f587e8f4fd670f11fa1e878c1015d7241033559a
Reported in the comments of QTBUG-24795
Change-Id: Id16e05e7d04d33605860926f7516d14cdefd6a36
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/thread')
-rw-r--r-- | src/corelib/thread/qmutex_linux.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/thread/qmutex_linux.cpp b/src/corelib/thread/qmutex_linux.cpp index 1644469763..4f70014acb 100644 --- a/src/corelib/thread/qmutex_linux.cpp +++ b/src/corelib/thread/qmutex_linux.cpp @@ -188,8 +188,8 @@ bool lockInternal_helper(QBasicAtomicPointer<QMutexData> &d_ptr, int timeout = - QElapsedTimer elapsedTimer; checkElapsedTimerIsTrivial(); if (IsTimed) { - ts.tv_sec = timeout / Q_INT64_C(1000) / 1000 / 1000; - ts.tv_nsec = timeout % Q_INT64_C(1000) * 1000 * 1000; + ts.tv_sec = timeout / 1000; + ts.tv_nsec = (timeout % 1000) * 1000 * 1000; elapsedTimer.start(); } |