MPD
0.20.6
|
Support for locking data structures from the database, for safe multi-threading. More...
#include "check.h"
#include "thread/Mutex.hxx"
#include "Compiler.h"
#include <assert.h>
#include "thread/Id.hxx"
Go to the source code of this file.
Data Structures | |
class | ScopeDatabaseLock |
class | ScopeDatabaseUnlock |
Unlock the database while in the current scope. More... | |
Functions | |
static gcc_pure bool | holding_db_lock (void) |
Does the current thread hold the database lock? More... | |
static void | db_lock (void) |
Obtain the global database lock. More... | |
static void | db_unlock (void) |
Release the global database lock. More... | |
Variables | |
Mutex | db_mutex |
ThreadId | db_mutex_holder |
Support for locking data structures from the database, for safe multi-threading.
Definition in file DatabaseLock.hxx.
|
inlinestatic |
Obtain the global database lock.
This is needed before dereferencing a #song or #directory. It is not recursive.
Definition at line 60 of file DatabaseLock.hxx.
|
inlinestatic |
Release the global database lock.
Definition at line 76 of file DatabaseLock.hxx.
|
inlinestatic |
Does the current thread hold the database lock?
Definition at line 48 of file DatabaseLock.hxx.
Mutex db_mutex |
ThreadId db_mutex_holder |