Take locks before signaling thread condition variables (#2636)

This commit is contained in:
mwilsnd
2024-07-19 16:11:13 -04:00
committed by GitHub
parent fcc57b6088
commit d15de92158
3 changed files with 5 additions and 2 deletions

View File

@@ -53,6 +53,8 @@ void TileCache::deferredRelease(std::unique_ptr<Tile>&& tile) {
// last one and the destruction actually occurs here on this thread.
std::function<void()> func{[tile_{CaptureWrapper<Tile>{std::move(tile)}}, this]() mutable {
tile_.item = {};
std::lock_guard<std::mutex> counterLock(deferredSignalLock);
deferredDeletionsPending--;
deferredSignal.notify_all();
}};