mirror of https://gitee.com/bigwinds/arangodb
Fix shutdown bug around ClusterComm and ClusterCommThread.
This commit is contained in:
parent
ffd617103f
commit
226fd54db2
|
@ -801,14 +801,15 @@ ClusterCommThread::~ClusterCommThread() { shutdown(); }
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
void ClusterCommThread::beginShutdown() {
|
void ClusterCommThread::beginShutdown() {
|
||||||
|
// Note that this is called from the destructor of the ClusterComm singleton
|
||||||
|
// object. This means that our pointer _cc is still valid and the condition
|
||||||
|
// variable in it is still OK. However, this method is called from a
|
||||||
|
// different thread than the ClusterCommThread. Therefore we can still
|
||||||
|
// use the condition variable to wake up the ClusterCommThread.
|
||||||
Thread::beginShutdown();
|
Thread::beginShutdown();
|
||||||
|
|
||||||
auto cc = ClusterComm::instance();
|
CONDITION_LOCKER(guard, _cc->somethingToSend);
|
||||||
|
guard.signal();
|
||||||
if (cc != nullptr) {
|
|
||||||
CONDITION_LOCKER(guard, cc->somethingToSend);
|
|
||||||
guard.signal();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
Loading…
Reference in New Issue