summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_runtime.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2017-08-24 17:43:32 +0300
committerIgor Sysoev <igor@sysoev.ru>2017-08-24 17:43:32 +0300
commitb84aa64dcbfb92d31cef10f2f45025a67f2418e4 (patch)
treebd7509540538801bdde233b24c0a130fbd6d757a /src/nxt_runtime.c
parent8b4b52ae3b3c9400b3d7040a591203a0c1b74ec3 (diff)
downloadunit-b84aa64dcbfb92d31cef10f2f45025a67f2418e4.tar.gz
unit-b84aa64dcbfb92d31cef10f2f45025a67f2418e4.tar.bz2
Removed configure option --no-threads.
Diffstat (limited to 'src/nxt_runtime.c')
-rw-r--r--src/nxt_runtime.c38
1 files changed, 3 insertions, 35 deletions
diff --git a/src/nxt_runtime.c b/src/nxt_runtime.c
index fcae4ed8..5fa4443d 100644
--- a/src/nxt_runtime.c
+++ b/src/nxt_runtime.c
@@ -42,12 +42,11 @@ static nxt_int_t nxt_runtime_log_files_create(nxt_task_t *task,
nxt_runtime_t *rt);
static nxt_int_t nxt_runtime_pid_file_create(nxt_task_t *task,
nxt_file_name_t *pid_file);
-
-#if (NXT_THREADS)
static void nxt_runtime_thread_pool_destroy(nxt_task_t *task, nxt_runtime_t *rt,
nxt_runtime_cont_t cont);
-#endif
-
+static void nxt_runtime_thread_pool_init(void);
+static void nxt_runtime_thread_pool_exit(nxt_task_t *task, void *obj,
+ void *data);
static void nxt_runtime_process_destroy(nxt_runtime_t *rt,
nxt_process_t *process);
static nxt_process_t *nxt_runtime_process_remove_pid(nxt_runtime_t *rt,
@@ -314,7 +313,6 @@ nxt_runtime_event_engines(nxt_task_t *task, nxt_runtime_t *rt)
static nxt_int_t
nxt_runtime_thread_pools(nxt_thread_t *thr, nxt_runtime_t *rt)
{
-#if (NXT_THREADS)
nxt_int_t ret;
nxt_array_t *thread_pools;
@@ -332,8 +330,6 @@ nxt_runtime_thread_pools(nxt_thread_t *thr, nxt_runtime_t *rt)
return NXT_ERROR;
}
-#endif
-
return NXT_OK;
}
@@ -358,8 +354,6 @@ nxt_runtime_start(nxt_task_t *task, void *obj, void *data)
goto fail;
}
-#if (NXT_THREADS)
-
/*
* Thread pools should be destroyed before starting worker
* processes, because thread pool semaphores will stick in
@@ -367,12 +361,6 @@ nxt_runtime_start(nxt_task_t *task, void *obj, void *data)
*/
nxt_runtime_thread_pool_destroy(task, rt, rt->start);
-#else
-
- rt->start(task->thread, rt);
-
-#endif
-
return;
fail:
@@ -446,7 +434,6 @@ fail:
static void
nxt_single_process_start(nxt_thread_t *thr, nxt_task_t *task, nxt_runtime_t *rt)
{
-#if (NXT_THREADS)
nxt_int_t ret;
ret = nxt_runtime_thread_pool_create(thr, rt, rt->auxiliary_threads,
@@ -457,8 +444,6 @@ nxt_single_process_start(nxt_thread_t *thr, nxt_task_t *task, nxt_runtime_t *rt)
return;
}
-#endif
-
rt->types |= (1U << NXT_PROCESS_SINGLE);
nxt_runtime_listen_sockets_enable(task, rt);
@@ -484,15 +469,11 @@ nxt_runtime_quit(nxt_task_t *task)
if (!engine->shutdown) {
engine->shutdown = 1;
-#if (NXT_THREADS)
-
if (!nxt_array_is_empty(rt->thread_pools)) {
nxt_runtime_thread_pool_destroy(task, rt, nxt_runtime_quit);
done = 0;
}
-#endif
-
if (nxt_runtime_is_master(rt)) {
nxt_master_stop_worker_processes(task, rt);
done = 0;
@@ -544,16 +525,12 @@ nxt_runtime_exit(nxt_task_t *task, void *obj, void *data)
rt = obj;
engine = data;
-#if (NXT_THREADS)
-
nxt_debug(task, "thread pools: %d", rt->thread_pools->nelts);
if (!nxt_array_is_empty(rt->thread_pools)) {
return;
}
-#endif
-
if (nxt_runtime_is_master(rt)) {
if (rt->pid_file != NULL) {
nxt_file_delete(rt->pid_file);
@@ -619,13 +596,6 @@ nxt_runtime_event_engine_free(nxt_runtime_t *rt)
}
-#if (NXT_THREADS)
-
-static void nxt_runtime_thread_pool_init(void);
-static void nxt_runtime_thread_pool_exit(nxt_task_t *task, void *obj,
- void *data);
-
-
nxt_int_t
nxt_runtime_thread_pool_create(nxt_thread_t *thr, nxt_runtime_t *rt,
nxt_uint_t max_threads, nxt_nsec_t timeout)
@@ -723,8 +693,6 @@ nxt_runtime_thread_pool_exit(nxt_task_t *task, void *obj, void *data)
}
}
-#endif
-
static nxt_int_t
nxt_runtime_conf_init(nxt_task_t *task, nxt_runtime_t *rt)