Skip to content

Commit bd2cd4b

Browse files
committed
shorten sleep duration while waiting for threads
1 parent 31c7c0c commit bd2cd4b

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

gclib/GThreads.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ void GThread::detach()
373373

374374
void GThread::wait_all() {
375375
while (GThread::num_running()>0)
376-
current_thread::sleep_for(2);
376+
current_thread::sleep_for(1);
377377
}
378378

379379

stringtie.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1332,11 +1332,11 @@ void noMoreBundles() {
13321332
if (areThreadsWaiting) {
13331333
DBGPRINT("##> NOTIFY ALL workers: no more data!\n");
13341334
haveBundles.notify_all();
1335-
current_thread::sleep_for(10);
1335+
current_thread::sleep_for(1);
13361336
waitMutex.lock();
13371337
areThreadsWaiting=(threadsWaiting>0);
13381338
waitMutex.unlock();
1339-
current_thread::sleep_for(10);
1339+
current_thread::sleep_for(1);
13401340
}
13411341
} while (areThreadsWaiting); //paranoid check that all threads stopped waiting
13421342
#else

0 commit comments

Comments
 (0)