mirror of https://gitee.com/bigwinds/arangodb
prevent lock from being moved from one thread to another
This commit is contained in:
parent
c7401910e0
commit
371a9fd046
|
@ -57,6 +57,7 @@ CollectionExport::~CollectionExport() {
|
||||||
_ditch->ditches()->freeDocumentDitch(_ditch, false);
|
_ditch->ditches()->freeDocumentDitch(_ditch, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if not already done
|
||||||
delete _guard;
|
delete _guard;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -136,4 +137,14 @@ void CollectionExport::run(uint64_t maxWaitTime, size_t limit) {
|
||||||
|
|
||||||
trx.finish(res);
|
trx.finish(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// delete guard right now as we're about to return
|
||||||
|
// if we would continue holding the guard's collection lock and return,
|
||||||
|
// and the export object gets later freed in a different thread, then all
|
||||||
|
// would be lost. so we'll release the lock here and rely on the cleanup
|
||||||
|
// thread not unloading the collection (as we've acquired a document ditch
|
||||||
|
// for the collection already - this will prevent unloading of the collection's
|
||||||
|
// datafiles etc.)
|
||||||
|
delete _guard;
|
||||||
|
_guard = nullptr;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue