/* * Copyright (C) 2014-present ScyllaDB */ /* * SPDX-License-Identifier: AGPL-3.0-or-later */ #pragma once #include #include #include #include #include #include "seastarx.hh" namespace fs = std::filesystem; namespace utils { class file_lock { public: file_lock() = delete; file_lock(const file_lock&) = delete; file_lock(file_lock&&) noexcept; ~file_lock(); file_lock& operator=(file_lock&&) = default; static future acquire(fs::path); fs::path path() const; sstring to_string() const { return path().native(); } private: class impl; file_lock(fs::path); std::unique_ptr _impl; }; std::ostream& operator<<(std::ostream& out, const file_lock& f); }