Airframe lockfile interface. More...
#include <airframe/autoinc.h>
Go to the source code of this file.
Data Structures | |
struct | _AirLock |
A lock structure. More... | |
Macros | |
#define | LOCK_ERROR_DOMAIN g_quark_from_string("airframeLockError") |
GError domain for lock errors. | |
#define | LOCK_ERROR_LOCK 1 |
A lock could not be acquired. | |
#define | AIR_LOCK_INIT { NULL, 0, FALSE } |
Convenience initializer for AirLock structures. | |
Typedefs | |
typedef struct _AirLock | AirLock |
A lock structure. More... | |
Functions | |
gboolean | air_lock_acquire (AirLock *lock, const char *path, GError **err) |
Acquire a lock. More... | |
void | air_lock_release (AirLock *lock) |
Release an acquired lock. More... | |
void | air_lock_cleanup (AirLock *lock) |
Free storage used by an AirLock structure. More... | |
Airframe lockfile interface.
Used to acquire lockfiles compatible with the Airframe filedaemon.
A lock structure.
Must be maintained by a caller from lock acquisition to release. Should be initialized by AIR_LOCK_INIT or memset(0) or bzero().
gboolean air_lock_acquire | ( | AirLock * | lock, |
const char * | path, | ||
GError ** | err | ||
) |
Acquire a lock.
Creates a lockfile and returns TRUE if the lockfile was created (and is now held).
lock | AirLock structure to store lockfile information in. |
path | path of file to lock (without .lock extension). |
err | an error descriptor |
void air_lock_cleanup | ( | AirLock * | lock | ) |
Free storage used by an AirLock structure.
Does not free the structure itself.
lock | AirLock to free |
void air_lock_release | ( | AirLock * | lock | ) |
Release an acquired lock.
lock | AirLock structure filled in by air_lock_acquire() |