From 06e0741a5293b1db2ef5f2b5778e3669f2dea70e Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 10 Jan 2013 09:30:01 +0100 Subject: PlayerControl: switch to the Mutex/Cond classes --- src/PlayerControl.hxx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/PlayerControl.hxx') diff --git a/src/PlayerControl.hxx b/src/PlayerControl.hxx index 1a0503209..322b95c84 100644 --- a/src/PlayerControl.hxx +++ b/src/PlayerControl.hxx @@ -21,6 +21,8 @@ #define MPD_PLAYER_H #include "audio_format.h" +#include "thread/Mutex.hxx" +#include "thread/Cond.hxx" #include @@ -99,12 +101,12 @@ struct player_control { /** * This lock protects #command, #state, #error. */ - GMutex *mutex; + Mutex mutex; /** * Trigger this object after you have modified #command. */ - GCond *cond; + Cond cond; enum player_command command; enum player_state state; @@ -158,7 +160,7 @@ struct player_control { static inline void player_lock(struct player_control *pc) { - g_mutex_lock(pc->mutex); + pc->mutex.lock(); } /** @@ -167,7 +169,7 @@ player_lock(struct player_control *pc) static inline void player_unlock(struct player_control *pc) { - g_mutex_unlock(pc->mutex); + pc->mutex.unlock(); } /** @@ -178,7 +180,7 @@ player_unlock(struct player_control *pc) static inline void player_wait(struct player_control *pc) { - g_cond_wait(pc->cond, pc->mutex); + pc->cond.wait(pc->mutex); } /** @@ -198,7 +200,7 @@ player_wait_decoder(struct player_control *pc, struct decoder_control *dc); static inline void player_signal(struct player_control *pc) { - g_cond_signal(pc->cond); + pc->cond.signal(); } /** -- cgit v1.2.3