aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2011-08-24 02:34:28 +0200
committerMax Kellermann <max@duempel.org>2011-08-24 02:55:05 +0200
commite242f3999c7f0219926877e4accf4763fec2972c (patch)
tree1c1631d0fcc231d1ba409cd351d6d932cd2da4bf /src/main.c
parent523f89cc8c661687f2994cafcd6ca7cf40eae49f (diff)
downloadmpd-e242f3999c7f0219926877e4accf4763fec2972c.tar.gz
mpd-e242f3999c7f0219926877e4accf4763fec2972c.tar.xz
mpd-e242f3999c7f0219926877e4accf4763fec2972c.zip
io_thread: new thread for non-blocking background I/O
Try to eliminate the remaining blocking I/O.
Diffstat (limited to '')
-rw-r--r--src/main.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index 2cb7dc5a4..52b1331c4 100644
--- a/src/main.c
+++ b/src/main.c
@@ -20,6 +20,7 @@
#include "config.h"
#include "main.h"
#include "daemon.h"
+#include "io_thread.h"
#include "client.h"
#include "client_idle.h"
#include "idle.h"
@@ -312,6 +313,7 @@ int mpd_main(int argc, char *argv[])
/* enable GLib's thread safety code */
g_thread_init(NULL);
+ io_thread_init();
winsock_init();
idle_init();
dirvec_init();
@@ -386,6 +388,12 @@ int mpd_main(int argc, char *argv[])
initSigHandlers();
+ if (!io_thread_start(&error)) {
+ g_warning("%s", error->message);
+ g_error_free(error);
+ return EXIT_FAILURE;
+ }
+
initZeroconf();
player_create(global_player_control);
@@ -474,6 +482,7 @@ int mpd_main(int argc, char *argv[])
dirvec_deinit();
idle_deinit();
stats_global_finish();
+ io_thread_deinit();
daemonize_finish();
#ifdef WIN32
WSACleanup();