summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/thread/qwaitcondition/tst_qwaitcondition.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/corelib/thread/qwaitcondition/tst_qwaitcondition.cpp')
-rw-r--r--tests/auto/corelib/thread/qwaitcondition/tst_qwaitcondition.cpp11
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;
}