CoreComponents 3.0.0
A Modern C++ Toolkit
Loading...
Searching...
No Matches
WriteLock Class Reference

Advisory file lock for exclusive access. More...

#include <cc/FileLock>

Inheritance diagram for WriteLock:

Public Member Functions

 WriteLock (const File &file, long long start=0, long long length=0, Seek whence=Seek::Begin)
 Create an exclusive file lock for a file area.
 
 WriteLock (const File &file, long long start=0, Seek whence=Seek::Begin)
 Create an exclusive file lock for a file area.
 
- Public Member Functions inherited from FileLock
 FileLock (const File &file, FileContention type, long long start=0, long long length=0, Seek whence=Seek::Begin)
 Create an advisory file lock for a file area.
 
 FileLock (const File &file, FileContention type, long long start, Seek whence=Seek::Begin)
 Create an advisory file lock for a file area.
 
bool tryAcquire ()
 Try to acquire the file lock.
 
void acquire ()
 Wait and acquire lock.
 
void release ()
 Release lock.
 

Detailed Description

Advisory file lock for exclusive access.

Constructor & Destructor Documentation

◆ WriteLock() [1/2]

WriteLock ( const File & file,
long long start = 0,
long long length = 0,
Seek whence = Seek::Begin )
explicit

Create an exclusive file lock for a file area.

Parameters
fileFile to lock
startStart offset of the file area
lengthLength of the file area
whenceInterpretation of start offset

◆ WriteLock() [2/2]

WriteLock ( const File & file,
long long start = 0,
Seek whence = Seek::Begin )
explicit

Create an exclusive file lock for a file area.

Parameters
fileFile to lock
startStart offset of the file area
whenceInterpretation of start offset