aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-01-02 21:01:01 +0100
committerMax Kellermann <max@duempel.org>2013-01-07 10:34:55 +0100
commit48025c2279c246236aca858f37759726a5d3042c (patch)
treec076eab33b953d7c4954d95b9b603c99dd7ed72e
parenta68302e50b835146cdb526a5850b9b19cb36a0ad (diff)
downloadmpd-48025c2279c246236aca858f37759726a5d3042c.tar.gz
mpd-48025c2279c246236aca858f37759726a5d3042c.tar.xz
mpd-48025c2279c246236aca858f37759726a5d3042c.zip
DatabaseLock: use the Mutex class instead of GLib's GMutex
-rw-r--r--src/DatabaseLock.cxx2
-rw-r--r--src/DatabaseLock.hxx7
2 files changed, 5 insertions, 4 deletions
diff --git a/src/DatabaseLock.cxx b/src/DatabaseLock.cxx
index 872b9bfd3..d0327d794 100644
--- a/src/DatabaseLock.cxx
+++ b/src/DatabaseLock.cxx
@@ -26,7 +26,7 @@
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
#endif
-GStaticMutex db_mutex = G_STATIC_MUTEX_INIT;
+Mutex db_mutex;
#ifndef NDEBUG
GThread *db_mutex_holder;
diff --git a/src/DatabaseLock.hxx b/src/DatabaseLock.hxx
index 6646fb43d..371a7d7b2 100644
--- a/src/DatabaseLock.hxx
+++ b/src/DatabaseLock.hxx
@@ -27,11 +27,12 @@
#define MPD_DB_LOCK_HXX
#include "check.h"
+#include "thread/Mutex.hxx"
#include <glib.h>
#include <assert.h>
-extern GStaticMutex db_mutex;
+extern Mutex db_mutex;
#ifndef NDEBUG
@@ -58,7 +59,7 @@ db_lock(void)
{
assert(!holding_db_lock());
- g_static_mutex_lock(&db_mutex);
+ db_mutex.lock();
assert(db_mutex_holder == NULL);
#ifndef NDEBUG
@@ -77,7 +78,7 @@ db_unlock(void)
db_mutex_holder = NULL;
#endif
- g_static_mutex_unlock(&db_mutex);
+ db_mutex.unlock();
}
#ifdef __cplusplus