mirror of https://gitee.com/bigwinds/arangodb
check for CREATED on shutdown
This commit is contained in:
parent
963578180a
commit
8a473c1f5b
|
@ -182,6 +182,12 @@ void Thread::beginShutdown() {
|
||||||
void Thread::shutdown(bool waitForStopped) {
|
void Thread::shutdown(bool waitForStopped) {
|
||||||
LOG_TOPIC(TRACE, Logger::THREADS) << "shutdown(" << _name << ")";
|
LOG_TOPIC(TRACE, Logger::THREADS) << "shutdown(" << _name << ")";
|
||||||
|
|
||||||
|
ThreadState state = _state.load();
|
||||||
|
|
||||||
|
while (state == ThreadState::CREATED) {
|
||||||
|
_state.compare_exchange_strong(state, ThreadState::STOPPED);
|
||||||
|
}
|
||||||
|
|
||||||
if (_state.load() == ThreadState::STARTED) {
|
if (_state.load() == ThreadState::STARTED) {
|
||||||
beginShutdown();
|
beginShutdown();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue