CernVM-FS  2.10.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
publish::ServerLockFile Class Reference

#include <repository_util.h>

Public Member Functions

 ServerLockFile (const std::string &path)
 
void Lock ()
 
bool TryLock ()
 
void Unlock ()
 
const std::string & path () const
 

Private Attributes

std::string path_
 
int fd_
 

Detailed Description

A server lock file is a POSIX lock file used to obtain mutually exclusive access to the repository while conducting an operation that modifies the repository state.

Since the lock is implemented using a POSIX lock file, the lock will automatically be released when the creating process exits.

Definition at line 51 of file repository_util.h.

Constructor & Destructor Documentation

publish::ServerLockFile::ServerLockFile ( const std::string &  path)
inlineexplicit

Definition at line 53 of file repository_util.h.

Member Function Documentation

void publish::ServerLockFile::Lock ( )

Definition at line 64 of file repository_util.cc.

Referenced by publish::ServerLockFileGuard::ServerLockFileGuard().

Here is the call graph for this function:

Here is the caller graph for this function:

const std::string& publish::ServerLockFile::path ( ) const
inline

Definition at line 59 of file repository_util.h.

bool publish::ServerLockFile::TryLock ( )

Definition at line 72 of file repository_util.cc.

Referenced by Lock(), and publish::ServerLockFileCheck::ServerLockFileCheck().

Here is the call graph for this function:

Here is the caller graph for this function:

void publish::ServerLockFile::Unlock ( )

Definition at line 86 of file repository_util.cc.

Referenced by publish::ServerLockFileCheck::~ServerLockFileCheck(), and publish::ServerLockFileGuard::~ServerLockFileGuard().

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

int publish::ServerLockFile::fd_
private

Definition at line 63 of file repository_util.h.

Referenced by TryLock(), and Unlock().

std::string publish::ServerLockFile::path_
private

Definition at line 62 of file repository_util.h.

Referenced by Lock(), path(), TryLock(), and Unlock().


The documentation for this class was generated from the following files: