summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_work_queue.c
diff options
context:
space:
mode:
authorMax Romanov <max.romanov@nginx.com>2017-07-18 00:21:17 +0300
committerMax Romanov <max.romanov@nginx.com>2017-07-18 00:21:17 +0300
commit8ad2c3fd3ad30982c4f777622c3392f047cc8191 (patch)
tree48cf79fd186b0c116223c78e9c8905c9f9085930 /src/nxt_work_queue.c
parent803855138c3b714c088e42a32e80939a81785944 (diff)
downloadunit-8ad2c3fd3ad30982c4f777622c3392f047cc8191.tar.gz
unit-8ad2c3fd3ad30982c4f777622c3392f047cc8191.tar.bz2
Work queue thread assertions. Reset thread after fork.
Diffstat (limited to '')
-rw-r--r--src/nxt_work_queue.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/nxt_work_queue.c b/src/nxt_work_queue.c
index 85f5cc3e..1b989eab 100644
--- a/src/nxt_work_queue.c
+++ b/src/nxt_work_queue.c
@@ -58,6 +58,26 @@ nxt_work_queue_thread_assert(nxt_work_queue_t *wq)
nxt_abort();
}
+
+void nxt_work_queue_thread_adopt(nxt_work_queue_t *wq)
+{
+ nxt_thread_t *thread;
+
+ thread = nxt_thread();
+
+ wq->pid = nxt_pid;
+ wq->tid = nxt_thread_tid(thread);
+}
+
+
+void
+nxt_work_queue_name(nxt_work_queue_t *wq, const char* name)
+{
+ nxt_work_queue_thread_assert(wq);
+
+ wq->name = name;
+}
+
#else
#define nxt_work_queue_thread_assert(wq)