Support for locking data structures from the database, for safe multi-threading.
More...
#include "check.h"
#include <glib.h>
#include <assert.h>
#include <stdbool.h>
Go to the source code of this file.
Functions |
static G_GNUC_PURE bool | holding_db_lock (void) |
| Does the current thread hold the database lock?
|
static void | db_lock (void) |
| Obtain the global database lock.
|
static void | db_unlock (void) |
| Release the global database lock.
|
Variables |
GStaticMutex | db_mutex |
GThread * | db_mutex_holder |
Detailed Description
Support for locking data structures from the database, for safe multi-threading.
Definition in file db_lock.h.
Function Documentation
static void db_lock |
( |
void |
| ) |
[inline, static] |
Obtain the global database lock.
This is needed before dereferencing a song or directory. It is not recursive.
Definition at line 58 of file db_lock.h.
static void db_unlock |
( |
void |
| ) |
[inline, static] |
Release the global database lock.
Definition at line 74 of file db_lock.h.
static G_GNUC_PURE bool holding_db_lock |
( |
void |
| ) |
[inline, static] |
Does the current thread hold the database lock?
Definition at line 46 of file db_lock.h.
Variable Documentation