#include <sbuild-lock.h>
Inheritance diagram for sbuild::file_lock:


Public Member Functions | |
| file_lock (int fd) | |
| The constructor. | |
| virtual | ~file_lock () |
| The destructor. | |
| virtual void | set_lock (lock::type lock_type, unsigned int timeout) |
| Acquire a lock. | |
| virtual void | unset_lock () |
| Release a lock. | |
Private Attributes | |
| int | fd |
| The file descriptor to lock. | |
| bool | locked |
| Is the file locked? | |
Simple whole-file shared and exclusive advisory locking based upon POSIX fcntl byte region locks.
| file_lock::file_lock | ( | int | fd | ) |
| file_lock::~file_lock | ( | ) | [virtual] |
The destructor.
| void file_lock::set_lock | ( | lock::type | lock_type, | |
| unsigned int | timeout | |||
| ) | [virtual] |
| void file_lock::unset_lock | ( | ) | [virtual] |
Release a lock.
This is equivalent to set_lock with a lock_type of LOCK_NONE and a timeout of 0.
Implements sbuild::lock.
int sbuild::file_lock::fd [private] |
The file descriptor to lock.
bool sbuild::file_lock::locked [private] |
Is the file locked?
1.5.2