diff options
author | Benjamin Barenblat <bbaren@mit.edu> | 2015-08-06 10:15:53 -0400 |
---|---|---|
committer | Benjamin Barenblat <bbaren@mit.edu> | 2015-08-06 10:15:53 -0400 |
commit | d22974b7912fab889a1e3ac73373e429e8b0ed7c (patch) | |
tree | 7647c80d07d015f69147ea6de9cd5eb61ea6c80f /src/c/urweb.c | |
parent | c657cb4f944860006a437d3cfd9940032e999913 (diff) |
Make OpenSSL usage thread-safe (closes #206)
Enable OpenSSL’s multithreading support by defining locking and
thread-ID callbacks. Remove a lock obviated by this change.
Diffstat (limited to 'src/c/urweb.c')
-rw-r--r-- | src/c/urweb.c | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/src/c/urweb.c b/src/c/urweb.c index 1e49dae0..6d3836f1 100644 --- a/src/c/urweb.c +++ b/src/c/urweb.c @@ -167,13 +167,8 @@ void *uw_init_client_data(); void uw_free_client_data(void *); void uw_copy_client_data(void *dst, void *src); -static pthread_mutex_t rand_mutex = PTHREAD_MUTEX_INITIALIZER; - static uw_Basis_int my_rand() { - pthread_mutex_lock(&rand_mutex); int ret, r = RAND_bytes((unsigned char *)&ret, sizeof ret); - pthread_mutex_unlock(&rand_mutex); - if (r) return abs(ret); else |