1
0
Fork 0

yield on shutdown

This commit is contained in:
jsteemann 2017-04-28 10:06:27 +02:00
parent e2853e4b52
commit 1d22f7bb61
1 changed files with 7 additions and 2 deletions

View File

@ -41,6 +41,8 @@
#include "Scheduler/JobQueue.h" #include "Scheduler/JobQueue.h"
#include "Scheduler/Task.h" #include "Scheduler/Task.h"
#include <thread>
using namespace arangodb; using namespace arangodb;
using namespace arangodb::basics; using namespace arangodb::basics;
using namespace arangodb::rest; using namespace arangodb::rest;
@ -429,8 +431,11 @@ void Scheduler::shutdown() {
bool done = false; bool done = false;
while (!done) { while (!done) {
MUTEX_LOCKER(guard, _threadsLock); {
done = _threads.empty(); MUTEX_LOCKER(guard, _threadsLock);
done = _threads.empty();
}
std::this_thread::yield();
} }
deleteOldThreads(); deleteOldThreads();