summaryrefslogtreecommitdiff
path: root/src/buildtool/storage/garbage_collector.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/buildtool/storage/garbage_collector.hpp')
-rw-r--r--src/buildtool/storage/garbage_collector.hpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/buildtool/storage/garbage_collector.hpp b/src/buildtool/storage/garbage_collector.hpp
index 0d80def0..18c9b280 100644
--- a/src/buildtool/storage/garbage_collector.hpp
+++ b/src/buildtool/storage/garbage_collector.hpp
@@ -20,6 +20,7 @@
#include <optional>
#include <string>
+#include "src/buildtool/storage/config.hpp"
#include "src/utils/cpp/file_locking.hpp"
// forward declarations
@@ -82,14 +83,19 @@ class GarbageCollector {
bool no_rotation = false) noexcept -> bool;
/// \brief Acquire shared lock to prevent garbage collection from running.
+ /// \param storage_config Storage to be locked.
/// \returns The acquired lock file on success or nullopt otherwise.
- [[nodiscard]] auto static SharedLock() noexcept -> std::optional<LockFile>;
+ [[nodiscard]] auto static SharedLock(
+ StorageConfig const& storage_config) noexcept
+ -> std::optional<LockFile>;
private:
- [[nodiscard]] auto static ExclusiveLock() noexcept
+ [[nodiscard]] auto static ExclusiveLock(
+ StorageConfig const& storage_config) noexcept
-> std::optional<LockFile>;
- [[nodiscard]] auto static LockFilePath() noexcept -> std::filesystem::path;
+ [[nodiscard]] auto static LockFilePath(
+ StorageConfig const& storage_config) noexcept -> std::filesystem::path;
/// \brief Remove spliced objects from the youngest generation and split
/// objects that are larger than the threshold.