aboutsummaryrefslogtreecommitdiffstats
path: root/src/PlayerControl.hxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-10-17 18:42:14 +0200
committerMax Kellermann <max@duempel.org>2013-10-17 19:29:47 +0200
commit8e676db633aa8888c8408a91ef219d2261ef42e2 (patch)
tree9e61e37ab5d181e90e89c5d4ced99c3434b3976c /src/PlayerControl.hxx
parentf6d74012b7a583bddf2e3b824193ade91fe09ce7 (diff)
downloadmpd-8e676db633aa8888c8408a91ef219d2261ef42e2.tar.gz
mpd-8e676db633aa8888c8408a91ef219d2261ef42e2.tar.xz
mpd-8e676db633aa8888c8408a91ef219d2261ef42e2.zip
Thread/Thread: replacement library for GThread
Diffstat (limited to 'src/PlayerControl.hxx')
-rw-r--r--src/PlayerControl.hxx16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/PlayerControl.hxx b/src/PlayerControl.hxx
index 4129ef080..b33462a5c 100644
--- a/src/PlayerControl.hxx
+++ b/src/PlayerControl.hxx
@@ -23,10 +23,9 @@
#include "AudioFormat.hxx"
#include "thread/Mutex.hxx"
#include "thread/Cond.hxx"
+#include "thread/Thread.hxx"
#include "util/Error.hxx"
-#include <glib.h>
-
#include <stdint.h>
struct Song;
@@ -95,9 +94,10 @@ struct player_control {
unsigned int buffered_before_play;
- /** the handle of the player thread, or NULL if the player
- thread isn't running */
- GThread *thread;
+ /**
+ * The handle of the player thread.
+ */
+ Thread thread;
/**
* This lock protects #command, #state, #error.
@@ -199,7 +199,7 @@ struct player_control {
* prior to calling this function.
*/
void Wait() {
- assert(thread == g_thread_self());
+ assert(thread.IsInside());
cond.wait(mutex);
}
@@ -210,7 +210,7 @@ struct player_control {
* Caller must lock the object.
*/
void ClientSignal() {
- assert(thread == g_thread_self());
+ assert(thread.IsInside());
client_cond.signal();
}
@@ -222,7 +222,7 @@ struct player_control {
* Caller must lock the object.
*/
void ClientWait() {
- assert(thread != g_thread_self());
+ assert(!thread.IsInside());
client_cond.wait(mutex);
}