aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
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();