22 #include <sbuild/lock.h>
23 #include <sbuild/custom-error.h>
77 unsigned int timeout) = 0;
117 set_timer (
const struct itimerval& timer);
152 unsigned int timeout);
A shared (read) lock.
Definition: lock.h:44
Failed to lock file (timed out).
Definition: lock.h:57
file_lock(int fd)
The constructor.
Definition: lock.cc:132
struct sigaction saved_signals
Signals saved during timeout.
Definition: lock.h:130
Debian source builder components.
Definition: ctty.cc:31
Failed to unlock device (timed out)
Definition: lock.h:63
Failed to unlock file.
Definition: lock.h:56
No lock.
Definition: lock.h:46
virtual void unset_lock()=0
Release a lock.
Failed to lock device.
Definition: lock.h:59
File lock.
Definition: lock.h:137
Advisory locking.
Definition: lock.h:38
void clear_alarm()
Restore the state of SIGALRM prior to starting lock acquisition.
Definition: lock.cc:98
An exclusive (write) lock.
Definition: lock.h:45
void set_alarm()
Set the SIGALARM handler.
Definition: lock.cc:86
custom_error< error_code > error
Exception type.
Definition: lock.h:67
error_code
Error codes.
Definition: lock.h:50
Failed to unlock device.
Definition: lock.h:62
virtual ~file_lock()
The destructor.
Definition: lock.cc:139
virtual void set_lock(type lock_type, unsigned int timeout)=0
Acquire a lock.
int fd
The file descriptor to lock.
Definition: lock.h:159
void unset_timer()
Remove any itimer currently set up.
Definition: lock.cc:117
bool locked
Is the file locked?
Definition: lock.h:161
Custom error.
Definition: custom-error.h:31
Failed to set timeout.
Definition: lock.h:53
Failed to cancel timeout.
Definition: lock.h:54
Failed to set timeout handler.
Definition: lock.h:52
virtual ~lock()
The destructor.
Definition: lock.cc:81
virtual void set_lock(lock::type lock_type, unsigned int timeout)
Acquire a lock.
Definition: lock.cc:159
virtual void unset_lock()
Release a lock.
Definition: lock.cc:213
lock()
The constructor.
Definition: lock.cc:76
Failed to test device lock.
Definition: lock.h:61
Failed to lock device (timed out).
Definition: lock.h:60
Failed to unlock file (timed out).
Definition: lock.h:58
Failed to lock file.
Definition: lock.h:55
type
Lock type.
Definition: lock.h:42
void set_timer(const struct itimerval &timer)
Set up an itimer for future expiry.
Definition: lock.cc:105