#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. | |
Simple whole-file shared and exclusive advisory locking based upon POSIX fcntl byte region locks.
Definition at line 135 of file sbuild-lock.h.
| file_lock::file_lock | ( | int | fd | ) |
The constructor.
| fd | the file descriptor to lock. |
Definition at line 148 of file sbuild-lock.cc.
| file_lock::~file_lock | ( | ) | [virtual] |
| void file_lock::set_lock | ( | lock::type | lock_type, | |
| unsigned int | timeout | |||
| ) | [virtual] |
Acquire a lock.
| lock_type | the type of lock to acquire. | |
| timeout | the time in seconds to wait on the lock. |
Implements sbuild::lock.
Definition at line 159 of file sbuild-lock.cc.
References sbuild::lock::LOCK, sbuild::lock::LOCK_TIMEOUT, sbuild::lock::set_timer(), and sbuild::lock::unset_timer().
Referenced by sbuild::chroot_config::load_data(), and unset_lock().
Here is the call graph for this function:

Here is the caller graph for this function:

| 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.
Definition at line 204 of file sbuild-lock.cc.
References sbuild::lock::LOCK_NONE, and set_lock().
Referenced by sbuild::chroot_config::load_data().
Here is the call graph for this function:

Here is the caller graph for this function:

int sbuild::file_lock::fd [private] |
1.5.1