wibble  1.1
Public Member Functions | Public Attributes | List of all members
wibble::sys::fs::Lockfile Struct Reference

RAII lock file. More...

#include <lockfile.h>

Public Member Functions

 Lockfile (const std::string &name, bool write=true)
 Create the lockfile with the given name. More...
 
 ~Lockfile ()
 

Public Attributes

std::string name
 
int fd
 

Detailed Description

RAII lock file.

It is implemented using fcntl, so that it should also work over network file systems. It should work at least on NFS and GFS.

Constructor & Destructor Documentation

◆ Lockfile()

wibble::sys::fs::Lockfile::Lockfile ( const std::string &  name,
bool  write = true 
)

Create the lockfile with the given name.

Parameters
writeIf false, use a read lock, else a write lock.

◆ ~Lockfile()

wibble::sys::fs::Lockfile::~Lockfile ( )

Member Data Documentation

◆ fd

int wibble::sys::fs::Lockfile::fd

◆ name

std::string wibble::sys::fs::Lockfile::name

The documentation for this struct was generated from the following file: