sbuild::FileLock Class Reference

File locks. More...

#include <sbuild-lock.h>

Inheritance diagram for sbuild::FileLock:

Inheritance graph
[legend]
Collaboration diagram for sbuild::FileLock:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 FileLock (int fd)
 The constructor.
virtual ~FileLock ()
 The destructor.
void set_lock (Type lock_type, unsigned int timeout)
void unset_lock ()
 Release a lock.

Private Attributes

int fd
 The file descriptor to lock.

Detailed Description

File locks.

Simple whole-file shared and exclusive advisory locking based upon POSIX fcntl byte region locks.


Constructor & Destructor Documentation

FileLock::FileLock int  fd  ) 
 

The constructor.

Parameters:
fd the file descriptor to lock.

FileLock::~FileLock  )  [virtual]
 

The destructor.


Member Function Documentation

void FileLock::set_lock Type  lock_type,
unsigned int  timeout
 

void FileLock::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.


Member Data Documentation

int sbuild::FileLock::fd [private]
 

The file descriptor to lock.


The documentation for this class was generated from the following files:
Generated on Wed Feb 1 11:43:55 2006 for schroot by  doxygen 1.4.6