diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/decode.c | 8 | ||||
-rw-r--r-- | src/notify.c | 14 | ||||
-rw-r--r-- | src/notify.h | 18 | ||||
-rw-r--r-- | src/player.c | 8 | ||||
-rw-r--r-- | src/playerData.c | 4 |
5 files changed, 26 insertions, 26 deletions
diff --git a/src/decode.c b/src/decode.c index 96a84b21a..5890d49d7 100644 --- a/src/decode.c +++ b/src/decode.c @@ -40,19 +40,19 @@ void decoder_wakeup_player(void) void decoder_sleep(void) { - notifyWait(&dc.notify); + notify_wait(&dc.notify); wakeup_player_nb(); } static void player_wakeup_decoder_nb(void) { - notifySignal(&dc.notify); + notify_signal(&dc.notify); } /* called from player_task */ static void player_wakeup_decoder(void) { - notifySignal(&dc.notify); + notify_signal(&dc.notify); player_sleep(); } @@ -322,7 +322,7 @@ stop_no_close: static void * decoder_task(mpd_unused void *arg) { - notifyEnter(&dc.notify); + notify_enter(&dc.notify); while (1) { assert(dc.state == DECODE_STATE_STOP); diff --git a/src/notify.c b/src/notify.c index 5d53b231d..ed46829ae 100644 --- a/src/notify.c +++ b/src/notify.c @@ -18,7 +18,7 @@ #include "notify.h" -int notifyInit(Notify *notify) +int notify_init(Notify *notify) { int ret; @@ -37,32 +37,32 @@ int notifyInit(Notify *notify) return 0; } -void notifyEnter(Notify *notify) +void notify_enter(Notify *notify) { pthread_mutex_lock(¬ify->mutex); } -void notifyLeave(Notify *notify) +void notify_leave(Notify *notify) { pthread_mutex_unlock(¬ify->mutex); } -void notifyWait(Notify *notify) +void notify_wait(Notify *notify) { if (!notify->pending) pthread_cond_wait(¬ify->cond, ¬ify->mutex); notify->pending = 0; } -void notifySignal(Notify *notify) +void notify_signal(Notify *notify) { notify->pending = 1; pthread_cond_signal(¬ify->cond); } -void notifySignalSync(Notify *notify) +void notify_signal_sync(Notify *notify) { pthread_mutex_lock(¬ify->mutex); - notifySignal(notify); + notify_signal(notify); pthread_mutex_unlock(¬ify->mutex); } diff --git a/src/notify.h b/src/notify.h index f79518f8f..0fbc74479 100644 --- a/src/notify.h +++ b/src/notify.h @@ -27,34 +27,34 @@ typedef struct _Notify { int pending; } Notify; -int notifyInit(Notify *notify); +int notify_init(Notify *notify); /** * The thread which shall be notified by this object must call this - * function before any notifyWait() invocation. It locks the mutex. + * function before any notify_wait() invocation. It locks the mutex. */ -void notifyEnter(Notify *notify); +void notify_enter(Notify *notify); /** - * Neutralize notifyLeave(). + * Neutralize notify_leave(). */ -void notifyLeave(Notify *notify); +void notify_leave(Notify *notify); /** * Wait for a notification. Return immediately if we have already - * been notified since we last returned from notifyWait(). + * been notified since we last returned from notify_wait(). */ -void notifyWait(Notify *notify); +void notify_wait(Notify *notify); /** * Notify the thread. This function never blocks. */ -void notifySignal(Notify *notify); +void notify_signal(Notify *notify); /** * Notify the thread synchonously, i.e. wait until it has received the * notification. */ -void notifySignalSync(Notify *notify); +void notify_signal_sync(Notify *notify); #endif diff --git a/src/player.c b/src/player.c index 80e0d2375..4d7762a0f 100644 --- a/src/player.c +++ b/src/player.c @@ -38,23 +38,23 @@ static void playerCloseAudio(void); void wakeup_player_nb(void) { - notifySignal(&pc.notify); + notify_signal(&pc.notify); } static void wakeup_player(void) { - notifySignal(&pc.notify); + notify_signal(&pc.notify); wait_main_task(); } void player_sleep(void) { - notifyWait(&pc.notify); + notify_wait(&pc.notify); } static void * player_task(mpd_unused void *arg) { - notifyEnter(&pc.notify); + notify_enter(&pc.notify); while (1) { if (pc.play) { diff --git a/src/playerData.c b/src/playerData.c index 56dee348c..103ec2980 100644 --- a/src/playerData.c +++ b/src/playerData.c @@ -79,7 +79,7 @@ void initPlayerData(void) ob_init(buffered_chunks); - notifyInit(&pc.notify); + notify_init(&pc.notify); pc.error = PLAYER_ERROR_NOERROR; pc.state = PLAYER_STATE_STOP; pc.queueState = PLAYER_QUEUE_BLANK; @@ -87,7 +87,7 @@ void initPlayerData(void) pc.crossFade = crossfade; pc.softwareVolume = 1000; - notifyInit(&dc.notify); + notify_init(&dc.notify); dc.state = DECODE_STATE_STOP; dc.error = DECODE_ERROR_NOERROR; } |