summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/kvstorage_server.c3
-rw-r--r--src/main.c6
2 files changed, 6 insertions, 3 deletions
diff --git a/src/kvstorage_server.c b/src/kvstorage_server.c
index 96b1d6f15..e608c63fc 100644
--- a/src/kvstorage_server.c
+++ b/src/kvstorage_server.c
@@ -1144,9 +1144,6 @@ start_keystorage (struct rspamd_worker *worker)
}
worker->srv->pid = getpid ();
ctx->threads = NULL;
-#if ((GLIB_MAJOR_VERSION == 2) && (GLIB_MINOR_VERSION <= 30))
- g_thread_init (NULL);
-#endif
#if _EVENT_NUMERIC_VERSION > 0x02000000
if (evthread_use_pthreads () == -1) {
diff --git a/src/main.c b/src/main.c
index 502b1f0e1..b55186ce3 100644
--- a/src/main.c
+++ b/src/main.c
@@ -385,6 +385,9 @@ fork_worker (struct rspamd_main *rspamd, struct worker_conf *cf)
/* Do silent log reopen to avoid collisions */
close_log (rspamd->logger);
open_log (rspamd->logger);
+#if ((GLIB_MAJOR_VERSION == 2) && (GLIB_MINOR_VERSION <= 30))
+ g_thread_init (NULL);
+#endif
msg_info ("starting %s process %P", cf->worker->name, getpid ());
cf->worker->worker_start_func (cur);
break;
@@ -821,6 +824,9 @@ main (gint argc, gchar **argv, gchar **env)
#ifdef HAVE_SA_SIGINFO
signals_info = g_queue_new ();
#endif
+#if ((GLIB_MAJOR_VERSION == 2) && (GLIB_MINOR_VERSION <= 30))
+ g_thread_init (NULL);
+#endif
rspamd_main = (struct rspamd_main *)g_malloc (sizeof (struct rspamd_main));
memset (rspamd_main, 0, sizeof (struct rspamd_main));
rspamd_main->server_pool = memory_pool_new (memory_pool_get_size ());