diff options
author | Klaus Aehlig <klaus.aehlig@huawei.com> | 2025-01-20 14:42:38 +0100 |
---|---|---|
committer | Klaus Aehlig <klaus.aehlig@huawei.com> | 2025-01-22 10:15:56 +0100 |
commit | 238a6075e611bad1873a0fa86dc553251506c85a (patch) | |
tree | e86fc12f88c1de9a77810dbb1d56cd9f050cc921 /src/buildtool/serve_api/serve_service/source_tree.cpp | |
parent | 1152bd6ad7176f5d53a4ae214f463431b5396f65 (diff) | |
download | justbuild-238a6075e611bad1873a0fa86dc553251506c85a.tar.gz |
Source-tree service: accept lock reference
... so that tagging in the associated git root can be synchronized
with other services provided by just serve.
Diffstat (limited to 'src/buildtool/serve_api/serve_service/source_tree.cpp')
-rw-r--r-- | src/buildtool/serve_api/serve_service/source_tree.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/buildtool/serve_api/serve_service/source_tree.cpp b/src/buildtool/serve_api/serve_service/source_tree.cpp index 8a45365d..f78c4f2c 100644 --- a/src/buildtool/serve_api/serve_service/source_tree.cpp +++ b/src/buildtool/serve_api/serve_service/source_tree.cpp @@ -576,7 +576,7 @@ auto SourceTreeService::ResolveContentTree( }); { // this is a non-thread-safe Git operation, so it must be guarded! - std::unique_lock slock{mutex_}; + std::unique_lock slock{*lock_}; // open real repository at Git CAS location auto git_repo = GitRepo::Open(native_context_->storage_config->GitRoot()); @@ -626,7 +626,7 @@ auto SourceTreeService::ArchiveImportToGit( unpack_path, /*commit_message=*/ fmt::format("Content of {} {}", archive_type, content), - &mutex_); + lock_); if (not res) { // report the error logger_->Emit(LogLevel::Error, "{}", res.error()); @@ -946,7 +946,7 @@ auto SourceTreeService::DistdirImportToGit( *native_context_->storage_config, tmp_path, /*commit_message=*/fmt::format("Content of distdir {}", content_id), - &mutex_); + lock_); if (not res) { // report the error logger_->Emit(LogLevel::Error, "{}", res.error()); @@ -1564,7 +1564,7 @@ auto SourceTreeService::CheckRootTree( *native_context_->storage_config, tmp_dir->GetPath(), /*commit_message=*/fmt::format("Content of tree {}", tree_id), - &mutex_); + lock_); if (not res) { // report the error logger_->Emit(LogLevel::Error, "{}", res.error()); @@ -1654,7 +1654,7 @@ auto SourceTreeService::GetRemoteTree( tmp_dir->GetPath(), /*commit_message=*/ fmt::format("Content of tree {}", remote_digest->hash()), - &mutex_); + lock_); if (not res) { // report the error logger_->Emit(LogLevel::Error, "{}", res.error()); @@ -1714,7 +1714,7 @@ auto SourceTreeService::ComputeTreeStructure( *tree_digest, known_repositories, *native_context_->storage_config, - &mutex_)) { + lock_)) { tree_structure = std::move(from_local).value(); } else { |