summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_process.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2017-07-10 21:07:12 +0300
committerIgor Sysoev <igor@sysoev.ru>2017-07-10 21:07:12 +0300
commit3bccb7f358e27f932c951a55bc17aa113bfae5f0 (patch)
tree78fc9f0fc0b20c7df284208db901eacc7dd6b6a8 /src/nxt_process.c
parentdc874cd22ef7ec72fc6e5927b1695d4a12536625 (diff)
downloadunit-3bccb7f358e27f932c951a55bc17aa113bfae5f0.tar.gz
unit-3bccb7f358e27f932c951a55bc17aa113bfae5f0.tar.bz2
Introducing thread-safe nxt_random().
Diffstat (limited to 'src/nxt_process.c')
-rw-r--r--src/nxt_process.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/nxt_process.c b/src/nxt_process.c
index 97b51c4e..7d5af92d 100644
--- a/src/nxt_process.c
+++ b/src/nxt_process.c
@@ -82,7 +82,9 @@ nxt_process_start(nxt_task_t *task, nxt_process_init_t *process)
nxt_process_title(task, "nginext: %s", process->name);
- nxt_random_init(&nxt_random_data);
+ thread = task->thread;
+
+ nxt_random_init(&thread->random);
if (process->user_cred != NULL && getuid() == 0) {
/* Super-user. */
@@ -93,7 +95,6 @@ nxt_process_start(nxt_task_t *task, nxt_process_init_t *process)
}
}
- thread = task->thread;
rt = thread->runtime;
rt->types |= (1U << process->type);