diff options
author | Igor Sysoev <igor@sysoev.ru> | 2017-07-10 21:07:12 +0300 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2017-07-10 21:07:12 +0300 |
commit | 3bccb7f358e27f932c951a55bc17aa113bfae5f0 (patch) | |
tree | 78fc9f0fc0b20c7df284208db901eacc7dd6b6a8 /src/nxt_random.h | |
parent | dc874cd22ef7ec72fc6e5927b1695d4a12536625 (diff) | |
download | unit-3bccb7f358e27f932c951a55bc17aa113bfae5f0.tar.gz unit-3bccb7f358e27f932c951a55bc17aa113bfae5f0.tar.bz2 |
Introducing thread-safe nxt_random().
Diffstat (limited to 'src/nxt_random.h')
-rw-r--r-- | src/nxt_random.h | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/src/nxt_random.h b/src/nxt_random.h index bfc4e3b3..f9c07e54 100644 --- a/src/nxt_random.h +++ b/src/nxt_random.h @@ -8,24 +8,6 @@ #define _NXT_RANDOM_H_INCLUDED_ -#if (NXT_HAVE_ARC4RANDOM) - -/* - * arc4random() has been introduced in OpenBSD 2.1 and then was ported - * to FreeBSD 2.2.6, NetBSD 2.0, MacOSX and SmartOS. - * - * arc4random() automatically initializes itself in the first call and - * then reinitializes itself in the first call in every forked processes. - */ - -typedef void *nxt_random_t; - - -#define nxt_random_init(r) -#define nxt_random(r) arc4random() - -#else - typedef struct { uint8_t i; uint8_t j; @@ -41,7 +23,5 @@ uint32_t nxt_random(nxt_random_t *r); nxt_int_t nxt_random_unit_test(nxt_thread_t *thr); #endif -#endif - #endif /* _NXT_RANDOM_H_INCLUDED_ */ |