DOKK / manpages / debian 11 / libcommoncpp2-doc / ost_Lockfile.3.en
ost::Lockfile(3) Library Functions Manual ost::Lockfile(3)

ost::Lockfile - This class is used to create a 'named' lock entity that can be used to control access to a resource between multiple processes.

#include <process.h>


Lockfile (const char *name)
Create a lock under a known name. Lockfile ()
Create a new lock object that can be used to make locks. ~Lockfile ()
Destroy the current lock and release it. bool lock (const char *name)
Lock a system-wide name for this process. void unlock (void)
Release an acquired lock. bool isLocked (void)
Flag if the current process has aqcuired a lock.

This class is used to create a 'named' lock entity that can be used to control access to a resource between multiple processes.

The posix implimentation uses a pidfile and the win32 version uses a globally visible mutex.

Author

David Sugar dyfet@ostel.com

System-wide named lock

Create a lock under a known name.

Parameters

name of system-wide lock to create.

Create a new lock object that can be used to make locks.

Destroy the current lock and release it.

Flag if the current process has aqcuired a lock.

Returns

true if we have the lock.

Lock a system-wide name for this process. If the lock is successful, return true. If an existing lock was already acquired, release it first.

Returns

true if lock successful.

Parameters

name system-wide lock to use.

Release an acquired lock.

Generated automatically by Doxygen for GNU CommonC++ from the source code.

Sun Dec 27 2020 GNU CommonC++