mirror of https://gitee.com/bigwinds/arangodb
yield on shutdown
This commit is contained in:
parent
e2853e4b52
commit
1d22f7bb61
|
@ -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();
|
||||||
|
|
Loading…
Reference in New Issue