summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_fiber.h
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2017-01-23 19:56:03 +0300
committerIgor Sysoev <igor@sysoev.ru>2017-01-23 19:56:03 +0300
commitde532922d9ab42aa15b40d47c8db53ac2af38500 (patch)
treed6b7c6b21c7a6e0e3620a3e0c7198e63454d05e3 /src/nxt_fiber.h
parent16cbf3c076a0aca6d47adaf3f719493674cf2363 (diff)
downloadunit-de532922d9ab42aa15b40d47c8db53ac2af38500.tar.gz
unit-de532922d9ab42aa15b40d47c8db53ac2af38500.tar.bz2
Introducing tasks.
Diffstat (limited to 'src/nxt_fiber.h')
-rw-r--r--src/nxt_fiber.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/nxt_fiber.h b/src/nxt_fiber.h
index 7d66612f..8e043b78 100644
--- a/src/nxt_fiber.h
+++ b/src/nxt_fiber.h
@@ -27,6 +27,8 @@ struct nxt_fiber_s {
size_t stack_size;
nxt_err_t err;
+ nxt_task_t task;
+
nxt_fiber_main_t *main;
nxt_fiber_t *next;
@@ -37,6 +39,7 @@ struct nxt_fiber_s {
struct nxt_fiber_main_s {
nxt_fiber_t fiber;
nxt_fiber_t *idle;
+ nxt_event_engine_t *engine;
size_t stack_size;
nxt_fid_t fid;
};
@@ -44,10 +47,10 @@ struct nxt_fiber_main_s {
nxt_fiber_main_t *nxt_fiber_main_create(nxt_event_engine_t *engine);
nxt_int_t nxt_fiber_create(nxt_fiber_start_t start, void *data, size_t stack);
-void nxt_fiber_yield(void);
-void nxt_fiber_sleep(nxt_msec_t timeout);
-void nxt_fiber_wait(void);
-void nxt_fiber_exit(nxt_fiber_t *next, void *data);
+void nxt_fiber_yield(nxt_task_t *task);
+void nxt_fiber_sleep(nxt_task_t *task, nxt_msec_t timeout);
+void nxt_fiber_wait(nxt_task_t *task);
+void nxt_fiber_exit(nxt_task_t *task, nxt_fiber_t *next, void *data);
NXT_EXPORT nxt_fiber_t *nxt_fiber_self(nxt_thread_t *thr);