summaryrefslogtreecommitdiff
path: root/src/buildtool/execution_api/execution_service/operation_cache.hpp
diff options
context:
space:
mode:
authorAlberto Sartori <alberto.sartori@huawei.com>2023-10-25 17:38:28 +0200
committerKlaus Aehlig <klaus.aehlig@huawei.com>2023-11-15 11:51:20 +0100
commit8aa7668ba6d9049644b02fcb6fbdba00fd8fdf67 (patch)
tree35ed9bea5d1036f9d63c1886aa1f19f16c99d538 /src/buildtool/execution_api/execution_service/operation_cache.hpp
parentc37a9fb6bd5d16543a557d46508c7f6d67b70c57 (diff)
downloadjustbuild-8aa7668ba6d9049644b02fcb6fbdba00fd8fdf67.tar.gz
just execute: fix race condition during garbage collection...
...of the internal cache used for keeping track of running operations. (cherry-picked from bec4dbd9bd995f73eab1ff803e7895187068ddb0)
Diffstat (limited to 'src/buildtool/execution_api/execution_service/operation_cache.hpp')
-rw-r--r--src/buildtool/execution_api/execution_service/operation_cache.hpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/buildtool/execution_api/execution_service/operation_cache.hpp b/src/buildtool/execution_api/execution_service/operation_cache.hpp
index 25ca49a7..2467add7 100644
--- a/src/buildtool/execution_api/execution_service/operation_cache.hpp
+++ b/src/buildtool/execution_api/execution_service/operation_cache.hpp
@@ -63,8 +63,8 @@ class OperationCache {
std::size_t threshold_{1U << kDefaultExponent};
void SetInternal(std::string const& action, Operation const& op) {
- GarbageCollection();
std::unique_lock lock{mutex_};
+ GarbageCollection();
cache_[action] = op;
}