Commit 97698bd4 authored by Max Kellerman's avatar Max Kellerman Committed by Eric Wong

notify: don't use camelCase in notify.[ch]

git-svn-id: https://svn.musicpd.org/mpd/trunk@7367 09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent e0be3aad
...@@ -40,19 +40,19 @@ void decoder_wakeup_player(void) ...@@ -40,19 +40,19 @@ void decoder_wakeup_player(void)
void decoder_sleep(void) void decoder_sleep(void)
{ {
notifyWait(&dc.notify); notify_wait(&dc.notify);
wakeup_player_nb(); wakeup_player_nb();
} }
static void player_wakeup_decoder_nb(void) static void player_wakeup_decoder_nb(void)
{ {
notifySignal(&dc.notify); notify_signal(&dc.notify);
} }
/* called from player_task */ /* called from player_task */
static void player_wakeup_decoder(void) static void player_wakeup_decoder(void)
{ {
notifySignal(&dc.notify); notify_signal(&dc.notify);
player_sleep(); player_sleep();
} }
...@@ -322,7 +322,7 @@ stop_no_close: ...@@ -322,7 +322,7 @@ stop_no_close:
static void * decoder_task(mpd_unused void *arg) static void * decoder_task(mpd_unused void *arg)
{ {
notifyEnter(&dc.notify); notify_enter(&dc.notify);
while (1) { while (1) {
assert(dc.state == DECODE_STATE_STOP); assert(dc.state == DECODE_STATE_STOP);
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#include "notify.h" #include "notify.h"
int notifyInit(Notify *notify) int notify_init(Notify *notify)
{ {
int ret; int ret;
...@@ -37,32 +37,32 @@ int notifyInit(Notify *notify) ...@@ -37,32 +37,32 @@ int notifyInit(Notify *notify)
return 0; return 0;
} }
void notifyEnter(Notify *notify) void notify_enter(Notify *notify)
{ {
pthread_mutex_lock(&notify->mutex); pthread_mutex_lock(&notify->mutex);
} }
void notifyLeave(Notify *notify) void notify_leave(Notify *notify)
{ {
pthread_mutex_unlock(&notify->mutex); pthread_mutex_unlock(&notify->mutex);
} }
void notifyWait(Notify *notify) void notify_wait(Notify *notify)
{ {
if (!notify->pending) if (!notify->pending)
pthread_cond_wait(&notify->cond, &notify->mutex); pthread_cond_wait(&notify->cond, &notify->mutex);
notify->pending = 0; notify->pending = 0;
} }
void notifySignal(Notify *notify) void notify_signal(Notify *notify)
{ {
notify->pending = 1; notify->pending = 1;
pthread_cond_signal(&notify->cond); pthread_cond_signal(&notify->cond);
} }
void notifySignalSync(Notify *notify) void notify_signal_sync(Notify *notify)
{ {
pthread_mutex_lock(&notify->mutex); pthread_mutex_lock(&notify->mutex);
notifySignal(notify); notify_signal(notify);
pthread_mutex_unlock(&notify->mutex); pthread_mutex_unlock(&notify->mutex);
} }
...@@ -27,34 +27,34 @@ typedef struct _Notify { ...@@ -27,34 +27,34 @@ typedef struct _Notify {
int pending; int pending;
} Notify; } Notify;
int notifyInit(Notify *notify); int notify_init(Notify *notify);
/** /**
* The thread which shall be notified by this object must call this * 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 * 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. * 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 * Notify the thread synchonously, i.e. wait until it has received the
* notification. * notification.
*/ */
void notifySignalSync(Notify *notify); void notify_signal_sync(Notify *notify);
#endif #endif
...@@ -38,23 +38,23 @@ static void playerCloseAudio(void); ...@@ -38,23 +38,23 @@ static void playerCloseAudio(void);
void wakeup_player_nb(void) void wakeup_player_nb(void)
{ {
notifySignal(&pc.notify); notify_signal(&pc.notify);
} }
static void wakeup_player(void) static void wakeup_player(void)
{ {
notifySignal(&pc.notify); notify_signal(&pc.notify);
wait_main_task(); wait_main_task();
} }
void player_sleep(void) void player_sleep(void)
{ {
notifyWait(&pc.notify); notify_wait(&pc.notify);
} }
static void * player_task(mpd_unused void *arg) static void * player_task(mpd_unused void *arg)
{ {
notifyEnter(&pc.notify); notify_enter(&pc.notify);
while (1) { while (1) {
if (pc.play) { if (pc.play) {
......
...@@ -79,7 +79,7 @@ void initPlayerData(void) ...@@ -79,7 +79,7 @@ void initPlayerData(void)
ob_init(buffered_chunks); ob_init(buffered_chunks);
notifyInit(&pc.notify); notify_init(&pc.notify);
pc.error = PLAYER_ERROR_NOERROR; pc.error = PLAYER_ERROR_NOERROR;
pc.state = PLAYER_STATE_STOP; pc.state = PLAYER_STATE_STOP;
pc.queueState = PLAYER_QUEUE_BLANK; pc.queueState = PLAYER_QUEUE_BLANK;
...@@ -87,7 +87,7 @@ void initPlayerData(void) ...@@ -87,7 +87,7 @@ void initPlayerData(void)
pc.crossFade = crossfade; pc.crossFade = crossfade;
pc.softwareVolume = 1000; pc.softwareVolume = 1000;
notifyInit(&dc.notify); notify_init(&dc.notify);
dc.state = DECODE_STATE_STOP; dc.state = DECODE_STATE_STOP;
dc.error = DECODE_ERROR_NOERROR; dc.error = DECODE_ERROR_NOERROR;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment