1 //===-- LockFileWindows.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 
9 #ifndef liblldb_Host_posix_LockFileWindows_h_
10 #define liblldb_Host_posix_LockFileWindows_h_
11 
12 #include "lldb/Host/LockFileBase.h"
13 #include "lldb/Host/windows/windows.h"
14 
15 namespace lldb_private {
16 
17 class LockFileWindows : public LockFileBase {
18 public:
19   explicit LockFileWindows(int fd);
20   ~LockFileWindows();
21 
22 protected:
23   Status DoWriteLock(const uint64_t start, const uint64_t len) override;
24 
25   Status DoTryWriteLock(const uint64_t start, const uint64_t len) override;
26 
27   Status DoReadLock(const uint64_t start, const uint64_t len) override;
28 
29   Status DoTryReadLock(const uint64_t start, const uint64_t len) override;
30 
31   Status DoUnlock() override;
32 
33   bool IsValidFile() const override;
34 
35 private:
36   HANDLE m_file;
37 };
38 
39 } // namespace lldb_private
40 
41 #endif // liblldb_Host_posix_LockFileWindows_h_
42