Make threading support optional
[framework/connectivity/connman.git] / src / main.c
index 104c5cc..5810813 100644 (file)
@@ -76,8 +76,10 @@ int main(int argc, char *argv[])
        DBusError err;
        struct sigaction sa;
 
+#ifdef NEED_THREADS
        if (g_thread_supported() == FALSE)
                g_thread_init(NULL);
+#endif
 
        context = g_option_context_new(NULL);
        g_option_context_add_main_entries(context, options, NULL);
@@ -108,10 +110,12 @@ int main(int argc, char *argv[])
 
        main_loop = g_main_loop_new(NULL, FALSE);
 
+#ifdef NEED_THREADS
        if (dbus_threads_init_default() == FALSE) {
                fprintf(stderr, "Can't init usage of threads\n");
                exit(1);
        }
+#endif
 
        dbus_error_init(&err);