Skip to content

Commit

Permalink
Removed fibers from compilation.
Browse files Browse the repository at this point in the history
It's not used anyway, but breaks building with musl.

This closes issue #5 on GitHub.
  • Loading branch information
VBart committed Sep 22, 2017
1 parent 6a78aed commit 45c1d41
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 7 deletions.
2 changes: 0 additions & 2 deletions auto/sources
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down Expand Up @@ -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 \
Expand Down
12 changes: 9 additions & 3 deletions src/nxt_app_log.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand All @@ -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) {
Expand All @@ -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);
Expand Down
5 changes: 5 additions & 0 deletions src/nxt_event_engine.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -138,9 +140,12 @@ nxt_event_engine_create(nxt_task_t *task,
nxt_work_queue_cache_destroy(&engine->work_queue_cache);
nxt_free(engine->fibers);

#if 0
fibers_fail:

nxt_free(engine);
#endif

return NULL;
}

Expand Down
2 changes: 2 additions & 0 deletions src/nxt_router.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 2 additions & 0 deletions src/nxt_runtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++;

Expand Down
4 changes: 2 additions & 2 deletions src/nxt_sprintf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions src/nxt_thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down

0 comments on commit 45c1d41

Please sign in to comment.