Skip to content

Commit

Permalink
normalize syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
TimSylvester committed Nov 20, 2024
1 parent 0d90208 commit a87359d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/mbgl/tile/tile_cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@ TileCache::~TileCache() {
clear();
pendingReleases.clear();

std::unique_lock<std::mutex> counterLock(deferredSignalLock);
while (deferredDeletionsPending != 0) {
deferredSignal.wait(counterLock);
}
std::unique_lock counterLock{deferredSignalLock};
deferredSignal.wait(counterLock, [&]() { return deferredDeletionsPending == 0; });
}

void TileCache::setSize(size_t size_) {
Expand Down Expand Up @@ -94,6 +92,7 @@ void TileCache::deferPendingReleases() {
deferredDeletionsPending--;
deferredSignal.notify_all();
}};

threadPool.schedule(std::move(func));
}

Expand Down

0 comments on commit a87359d

Please sign in to comment.