| 10 | }; |
| 11 | |
| 12 | class TFileLock: public TFile { |
| 13 | public: |
| 14 | TFileLock(const TString& filename, const EFileLockType type = EFileLockType::Exclusive); |
| 15 | |
| 16 | void Acquire(); |
| 17 | bool TryAcquire(); |
| 18 | void Release(); |
| 19 | |
| 20 | inline void lock() { |
| 21 | Acquire(); |
| 22 | } |
| 23 | |
| 24 | inline bool try_lock() { |
| 25 | return TryAcquire(); |
| 26 | } |
| 27 | |
| 28 | inline void unlock() { |
| 29 | Release(); |
| 30 | } |
| 31 | |
| 32 | private: |
| 33 | EFileLockType Type; |
| 34 | }; |
no outgoing calls
no test coverage detected