projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
x86_64 assembly pack: "optimize" for Knights Landing, add AVX-512 results.
[openssl.git]
/
crypto
/
threads_pthread.c
diff --git
a/crypto/threads_pthread.c
b/crypto/threads_pthread.c
index 5b10f438b9cb7ae98607d6cb2513bcb9faf755c1..f7c792123bc0748a8c672a944ae1385a329deb9b 100644
(file)
--- a/
crypto/threads_pthread.c
+++ b/
crypto/threads_pthread.c
@@
-8,6
+8,7
@@
*/
#include <openssl/crypto.h>
*/
#include <openssl/crypto.h>
+#include <internal/cryptlib.h>
#if defined(OPENSSL_THREADS) && !defined(CRYPTO_TDEBUG) && !defined(OPENSSL_SYS_WINDOWS)
#if defined(OPENSSL_THREADS) && !defined(CRYPTO_TDEBUG) && !defined(OPENSSL_SYS_WINDOWS)
@@
-28,7
+29,6
@@
CRYPTO_RWLOCK *CRYPTO_THREAD_lock_new(void)
}
# else
pthread_mutexattr_t attr;
}
# else
pthread_mutexattr_t attr;
-
CRYPTO_RWLOCK *lock = OPENSSL_zalloc(sizeof(pthread_mutex_t));
if (lock == NULL)
return NULL;
CRYPTO_RWLOCK *lock = OPENSSL_zalloc(sizeof(pthread_mutex_t));
if (lock == NULL)
return NULL;
@@
-169,4
+169,13
@@
int CRYPTO_atomic_add(int *val, int amount, int *ret, CRYPTO_RWLOCK *lock)
return 1;
}
return 1;
}
+int openssl_init_fork_handlers(void)
+{
+# ifdef OPENSSL_SYS_UNIX
+ if (pthread_atfork(OPENSSL_fork_prepare,
+ OPENSSL_fork_parent, OPENSSL_fork_child) == 0)
+ return 1;
+# endif
+ return 0;
+}
#endif
#endif