comparison src/c/openssl.c @ 2263:dfadb5effdc0

Merge bbaren's fix for bug 209.
author Ziv Scully <ziv@mit.edu>
date Tue, 13 Oct 2015 14:22:05 -0400
parents c275bbc41194 ce312cad5ecd
children
comparison
equal deleted inserted replaced
2262:34ad83d9b729 2263:dfadb5effdc0
32 exit(1); 32 exit(1);
33 } 33 }
34 } 34 }
35 35
36 // OpenSSL callbacks 36 // OpenSSL callbacks
37 #ifdef PTHREAD_T_IS_POINTER
38 # define CRYPTO_THREADID_SET CRYPTO_THREADID_set_pointer
39 #else
40 # define CRYPTO_THREADID_SET CRYPTO_THREADID_set_numeric
41 #endif
37 static void thread_id(CRYPTO_THREADID *const result) { 42 static void thread_id(CRYPTO_THREADID *const result) {
38 CRYPTO_THREADID_set_numeric(result, (unsigned long)pthread_self()); 43 CRYPTO_THREADID_SET(result, pthread_self());
39 } 44 }
45 #undef CRYPTO_THREADID_SET
40 static void lock_or_unlock(const int mode, const int type, const char *file, 46 static void lock_or_unlock(const int mode, const int type, const char *file,
41 const int line) { 47 const int line) {
42 pthread_mutex_t *const lock = &openssl_locks[type]; 48 pthread_mutex_t *const lock = &openssl_locks[type];
43 if (mode & CRYPTO_LOCK) { 49 if (mode & CRYPTO_LOCK) {
44 if (pthread_mutex_lock(lock)) { 50 if (pthread_mutex_lock(lock)) {