All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Radiant::LockFile Class Reference

Platform independent lockfile. More...

#include <Radiant/LockFile.hpp>

Public Member Functions

bool isLocked () const
 Check if the file is locked. More...
 
 LockFile (const char *filename)
 Tries to acquire an exclusive lock on the given file. More...
 
 ~LockFile ()
 Releases the lock.
 

Detailed Description

Platform independent lockfile.

This can be used as a multi-process mutex

Constructor & Destructor Documentation

Radiant::LockFile::LockFile ( const char *  filename)

Tries to acquire an exclusive lock on the given file.

No other operations should be done on this file If the file doesn't exist it is created.

Parameters
filenameFilename of lockfile

Member Function Documentation

bool Radiant::LockFile::isLocked ( ) const

Check if the file is locked.

Returns
true if the file was succesfully locked for exclusive use