diff options
Diffstat (limited to 'evutil_rand.c')
-rw-r--r-- | evutil_rand.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/evutil_rand.c b/evutil_rand.c index 58d8bd9e..fbb0ed43 100644 --- a/evutil_rand.c +++ b/evutil_rand.c @@ -50,11 +50,13 @@ evutil_secure_rng_init(void) (void) arc4random(); return 0; } +#ifndef EVENT__DISABLE_THREAD_SUPPORT int evutil_secure_rng_global_setup_locks_(const int enable_locks) { return 0; } +#endif static void ev_arc4random_buf(void *buf, size_t n) @@ -112,6 +114,22 @@ evutil_secure_rng_global_setup_locks_(const int enable_locks) } #endif +static void +evutil_free_secure_rng_globals_locks(void) +{ +#ifndef EVENT__DISABLE_THREAD_SUPPORT + if (arc4rand_lock != NULL) { + EVTHREAD_FREE_LOCK(arc4rand_lock, 0); + } +#endif + return; +} +void +evutil_free_secure_rng_globals_(void) { +{ + evutil_free_secure_rng_globals_locks(); +} + int evutil_secure_rng_init(void) { |