boringssl/crypto/rand_extra
Adam Langley 8e8f250422 Use thread-local storage for PRNG states if fork-unsafe buffering is enabled.
We switched from thread-local storage to a mutex-pool in 82639e6f53
because, for highly-threaded processes, the memory used by all the
states could be quite large. I had judged that a mutex-pool should be
fine, but had underestimated the PRNG requirements of some of our jobs.

This change makes rand.c support using either thread-locals or a
mutex-pool. Thread-locals are used if fork-unsafe buffering is enabled.
While not strictly related to fork-safety, we already have the
fork-unsafe control, and it's already set by jobs that care a lot about
PRNG performance, so fits quite nicely here.

Change-Id: Iaf1e0171c70d4c8dbe1e42283ea13df5b613cb2d
Reviewed-on: https://boringssl-review.googlesource.com/c/31564
Commit-Queue: Adam Langley <agl@google.com>
Reviewed-by: David Benjamin <davidben@google.com>
2018-12-28 18:05:18 +00:00
..
deterministic.c Run the comment converter on libcrypto. 2017-08-18 21:49:04 +00:00
forkunsafe.c Use thread-local storage for PRNG states if fork-unsafe buffering is enabled. 2018-12-28 18:05:18 +00:00
fuchsia.c [fuchsia] Update to zx_cprng_draw 2018-06-28 21:08:18 +00:00
rand_extra.c Run the comment converter on libcrypto. 2017-08-18 21:49:04 +00:00
rand_test.cc [rand] Disable RandTest.Fork on Fuchsia 2018-10-16 18:57:29 +00:00
windows.c Run the comment converter on libcrypto. 2017-08-18 21:49:04 +00:00