diff src/c/urweb.c @ 2166:8a01e8f21de9

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.
author Benjamin Barenblat <bbaren@mit.edu>
date Thu, 06 Aug 2015 10:15:53 -0400
parents 4895c41b2ec6
children d2a98983f502 c05851bf7861
line wrap: on
line diff
--- a/src/c/urweb.c	Thu Aug 06 09:57:47 2015 -0400
+++ b/src/c/urweb.c	Thu Aug 06 10:15:53 2015 -0400
@@ -167,13 +167,8 @@
 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