From 8e676db633aa8888c8408a91ef219d2261ef42e2 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 17 Oct 2013 18:42:14 +0200 Subject: Thread/Thread: replacement library for GThread --- src/PlayerControl.hxx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/PlayerControl.hxx') 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 - #include 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); } -- cgit v1.2.3