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>
This commit is contained in:
parent
19e295b330
commit
ee632a21f6
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user