LockFilePosix.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. //===-- LockFilePosix.h -----------------------------------------*- C++ -*-===//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. #ifndef LLDB_HOST_POSIX_LOCKFILEPOSIX_H
  9. #define LLDB_HOST_POSIX_LOCKFILEPOSIX_H
  10. #include "lldb/Host/LockFileBase.h"
  11. namespace lldb_private {
  12. class LockFilePosix : public LockFileBase {
  13. public:
  14. explicit LockFilePosix(int fd);
  15. ~LockFilePosix() override;
  16. protected:
  17. Status DoWriteLock(const uint64_t start, const uint64_t len) override;
  18. Status DoTryWriteLock(const uint64_t start, const uint64_t len) override;
  19. Status DoReadLock(const uint64_t start, const uint64_t len) override;
  20. Status DoTryReadLock(const uint64_t start, const uint64_t len) override;
  21. Status DoUnlock() override;
  22. };
  23. } // namespace lldb_private
  24. #endif // LLDB_HOST_POSIX_LOCKFILEPOSIX_H