summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorValentin Bartenev <vbart@nginx.com>2017-09-22 16:42:42 +0300
committerValentin Bartenev <vbart@nginx.com>2017-09-22 16:42:42 +0300
commit45c1d41f34031c26344832f92837f08c0dbfba04 (patch)
tree13dcfc887eb020a59b9d8090bfa70e66858d97ea
parent6a78aedb7e6eef061bec4fc406fe930154b128fe (diff)
downloadunit-45c1d41f34031c26344832f92837f08c0dbfba04.tar.gz
unit-45c1d41f34031c26344832f92837f08c0dbfba04.tar.bz2
Removed fibers from compilation.
It's not used anyway, but breaks building with musl. This closes issue #5 on GitHub.
-rw-r--r--auto/sources2
-rw-r--r--src/nxt_app_log.c12
-rw-r--r--src/nxt_event_engine.c5
-rw-r--r--src/nxt_router.c2
-rw-r--r--src/nxt_runtime.c2
-rw-r--r--src/nxt_sprintf.c4
-rw-r--r--src/nxt_thread.h2
7 files changed, 22 insertions, 7 deletions
diff --git a/auto/sources b/auto/sources
index c1d8b37f..f2760ad6 100644
--- a/auto/sources
+++ b/auto/sources
@@ -57,7 +57,6 @@ NXT_LIB_DEPS=" \
src/nxt_thread_pool.h \
src/nxt_work_queue.h \
src/nxt_service.h \
- src/nxt_fiber.h \
src/nxt_log_moderation.h \
src/nxt_event_engine.h \
src/nxt_timer.h \
@@ -128,7 +127,6 @@ NXT_LIB_SRCS=" \
src/nxt_time_parse.c \
src/nxt_work_queue.c \
src/nxt_service.c \
- src/nxt_fiber.c \
src/nxt_log_moderation.c \
src/nxt_event_engine.c \
src/nxt_timer.c \
diff --git a/src/nxt_app_log.c b/src/nxt_app_log.c
index 0519c018..013fae46 100644
--- a/src/nxt_app_log.c
+++ b/src/nxt_app_log.c
@@ -21,9 +21,6 @@ nxt_log_time_handler(nxt_uint_t level, nxt_log_t *log, const char *fmt, ...)
{
u_char *p, *syslogmsg, *end;
va_list args;
- nxt_fid_t fid;
- const char *id;
- nxt_fiber_t *fib;
nxt_thread_t *thr;
nxt_time_string_t *time_cache;
u_char msg[NXT_MAX_ERROR_STR];
@@ -39,6 +36,11 @@ nxt_log_time_handler(nxt_uint_t level, nxt_log_t *log, const char *fmt, ...)
syslogmsg = p;
+#if 0
+ nxt_fid_t fid;
+ const char *id;
+ nxt_fiber_t *fib;
+
fib = nxt_fiber_self(thr);
if (fib != NULL) {
@@ -52,6 +54,10 @@ nxt_log_time_handler(nxt_uint_t level, nxt_log_t *log, const char *fmt, ...)
p = nxt_sprintf(p, end, id, &nxt_log_levels[level], nxt_pid,
nxt_thread_tid(thr), fid);
+#else
+ p = nxt_sprintf(p, end, "[%V] %PI#%PT ", &nxt_log_levels[level], nxt_pid,
+ nxt_thread_tid(thr));
+#endif
if (log->ident != 0) {
p = nxt_sprintf(p, end, "*%D ", log->ident);
diff --git a/src/nxt_event_engine.c b/src/nxt_event_engine.c
index ba297329..7f20c4c8 100644
--- a/src/nxt_event_engine.c
+++ b/src/nxt_event_engine.c
@@ -48,12 +48,14 @@ nxt_event_engine_create(nxt_task_t *task,
engine->batch = batch;
+#if 0
if (flags & NXT_ENGINE_FIBERS) {
engine->fibers = nxt_fiber_main_create(engine);
if (engine->fibers == NULL) {
goto fibers_fail;
}
}
+#endif
engine->current_work_queue = &engine->fast_work_queue;
@@ -138,9 +140,12 @@ signals_fail:
nxt_work_queue_cache_destroy(&engine->work_queue_cache);
nxt_free(engine->fibers);
+#if 0
fibers_fail:
nxt_free(engine);
+#endif
+
return NULL;
}
diff --git a/src/nxt_router.c b/src/nxt_router.c
index d9ba2d24..d3c60a94 100644
--- a/src/nxt_router.c
+++ b/src/nxt_router.c
@@ -1814,7 +1814,9 @@ nxt_router_thread_start(void *data)
engine->task.log = thread->log;
thread->engine = engine;
thread->task = &engine->task;
+#if 0
thread->fiber = &engine->fibers->fiber;
+#endif
engine->mem_pool = nxt_mp_create(4096, 128, 1024, 64);
diff --git a/src/nxt_runtime.c b/src/nxt_runtime.c
index ac0775ee..886bd1ca 100644
--- a/src/nxt_runtime.c
+++ b/src/nxt_runtime.c
@@ -292,7 +292,9 @@ nxt_runtime_event_engines(nxt_task_t *task, nxt_runtime_t *rt)
thread = task->thread;
thread->engine = engine;
+#if 0
thread->fiber = &engine->fibers->fiber;
+#endif
engine->id = rt->last_engine_id++;
diff --git a/src/nxt_sprintf.c b/src/nxt_sprintf.c
index 4b77725f..933ce997 100644
--- a/src/nxt_sprintf.c
+++ b/src/nxt_sprintf.c
@@ -500,12 +500,12 @@ nxt_vsprintf(u_char *buf, u_char *end, const char *fmt, va_list args)
ui64 = (uint64_t) va_arg(args, nxt_tid_t);
sign = 0;
goto number;
-
+#if 0
case 'F':
ui64 = (uint64_t) va_arg(args, nxt_fid_t);
sign = 0;
goto number;
-
+#endif
case 'H':
ui64 = (uint64_t) (uintptr_t) va_arg(args, pthread_t);
spf.hex = HEXADECIMAL;
diff --git a/src/nxt_thread.h b/src/nxt_thread.h
index 4a71a5a1..2ebc331d 100644
--- a/src/nxt_thread.h
+++ b/src/nxt_thread.h
@@ -159,11 +159,13 @@ struct nxt_thread_s {
nxt_event_engine_t *engine;
void *data;
+#if 0
/*
* Although pointer to a current fiber should be a property of
* engine->fibers, its placement here eliminates 2 memory accesses.
*/
nxt_fiber_t *fiber;
+#endif
nxt_random_t random;
};