Removed fibers from compilation.

It's not used anyway, but breaks building with musl.

This closes issue #5 on GitHub.
This commit is contained in:
Valentin Bartenev
2017-09-22 16:42:42 +03:00
parent 6a78aedb7e
commit 45c1d41f34
7 changed files with 22 additions and 7 deletions

View File

@@ -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 \

View File

@@ -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);

View File

@@ -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;
}

View File

@@ -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);

View File

@@ -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++;

View File

@@ -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;

View File

@@ -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;
};