diff options
author | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-11-26 12:13:14 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-11-26 15:51:07 +0000 |
commit | ee632a21f6d4f6ea1d4fe7e41cca0fee307c5e39 (patch) | |
tree | 7a9463eb326ce78dc76dd7bcde1a75601798c8e8 /tests/auto | |
parent | 19e295b330db4b34570c1719b0b69e531288cbd0 (diff) |
tst_QWaitCondition::wakeOne(): Increase wait interval.
Introduce constants and make the interval for the 2nd thread a bit
longer.
Task-number: QTBUG-49653
Change-Id: I92ac0494ec6c9af5bde858007d08e26210215434
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/corelib/thread/qwaitcondition/tst_qwaitcondition.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/auto/corelib/thread/qwaitcondition/tst_qwaitcondition.cpp b/tests/auto/corelib/thread/qwaitcondition/tst_qwaitcondition.cpp index 6a2ea7c73c..df52aa4949 100644 --- a/tests/auto/corelib/thread/qwaitcondition/tst_qwaitcondition.cpp +++ b/tests/auto/corelib/thread/qwaitcondition/tst_qwaitcondition.cpp @@ -453,6 +453,9 @@ public: void tst_QWaitCondition::wakeOne() { + static const int firstWaitInterval = 1000; + static const int waitInterval = 30; + int x; QAtomicInt count; // wake up threads, one at a time @@ -497,7 +500,7 @@ void tst_QWaitCondition::wakeOne() for (int y = 0; y < ThreadCount; ++y) { if (thread_exited[y]) continue; - if (thread[y].wait(exited > 0 ? 10 : 1000)) { + if (thread[y].wait(exited > 0 ? waitInterval : firstWaitInterval)) { thread_exited[y] = true; ++exited; } @@ -546,7 +549,7 @@ void tst_QWaitCondition::wakeOne() for (int y = 0; y < ThreadCount; ++y) { if (thread_exited[y]) continue; - if (rwthread[y].wait(exited > 0 ? 10 : 1000)) { + if (rwthread[y].wait(exited > 0 ? waitInterval : firstWaitInterval)) { thread_exited[y] = true; ++exited; } @@ -603,7 +606,7 @@ void tst_QWaitCondition::wakeOne() for (int y = 0; y < ThreadCount; ++y) { if (thread_exited[y]) continue; - if (thread[y].wait(exited > 0 ? 10 : 1000)) { + if (thread[y].wait(exited > 0 ? waitInterval : firstWaitInterval)) { thread_exited[y] = true; ++exited; } @@ -654,7 +657,7 @@ void tst_QWaitCondition::wakeOne() for (int y = 0; y < ThreadCount; ++y) { if (thread_exited[y]) continue; - if (rwthread[y].wait(exited > 0 ? 10 : 1000)) { + if (rwthread[y].wait(exited > 0 ? waitInterval : firstWaitInterval)) { thread_exited[y] = true; ++exited; } |