aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-10-31 17:02:12 +0100
committerMax Kellermann <max@duempel.org>2009-10-31 17:02:12 +0100
commit25a806a347ce420126eb75d82c5fb875eb0a5e0d (patch)
tree0d39bed8c073a720acd42f17b04dbee91b0a8c01 /src/main.c
parent73cff374fd94a1c16e0201fcda020396c0f41962 (diff)
downloadmpd-25a806a347ce420126eb75d82c5fb875eb0a5e0d.tar.gz
mpd-25a806a347ce420126eb75d82c5fb875eb0a5e0d.tar.xz
mpd-25a806a347ce420126eb75d82c5fb875eb0a5e0d.zip
player_control: protect command, state, error with a mutex
Use GMutex/GCond instead of the notify library. Manually lock the player_control object before accessing the protected attributes. Use the GCond object to notify the player thread and the main thread.
Diffstat (limited to '')
-rw-r--r--src/main.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main.c b/src/main.c
index 86fe069e5..18647eb80 100644
--- a/src/main.c
+++ b/src/main.c
@@ -93,7 +93,7 @@ enum {
GThread *main_task;
GMainLoop *main_loop;
-struct notify main_notify;
+GCond *main_cond;
static void
glue_daemonize_init(const struct options *options)
@@ -321,7 +321,7 @@ int main(int argc, char *argv[])
main_task = g_thread_self();
main_loop = g_main_loop_new(NULL, FALSE);
- notify_init(&main_notify);
+ main_cond = g_cond_new();
event_pipe_init();
event_pipe_register(PIPE_EVENT_IDLE, idle_event_emitted);
@@ -415,7 +415,7 @@ int main(int argc, char *argv[])
sticker_global_finish();
#endif
- notify_deinit(&main_notify);
+ g_cond_free(main_cond);
event_pipe_deinit();
playlist_list_global_finish();