From: Adam Dickmeiss Date: Thu, 13 Mar 2014 13:05:36 +0000 (+0100) Subject: Initialize gcrypt for threaded mode YAZ-751 X-Git-Tag: v5.0.20~4 X-Git-Url: http://sru.miketaylor.org.uk/?a=commitdiff_plain;h=7b35dc1bb4add8c5db287eecdf57bb872751eea3;p=yaz-moved-to-github.git Initialize gcrypt for threaded mode YAZ-751 --- diff --git a/src/init_globals.c b/src/init_globals.c index 81cb966..79845f4 100644 --- a/src/init_globals.c +++ b/src/init_globals.c @@ -15,6 +15,7 @@ #if YAZ_POSIX_THREADS #include #endif +#include #if HAVE_GNUTLS_H #include @@ -35,6 +36,10 @@ static pthread_mutex_t yaz_init_mutex = PTHREAD_MUTEX_INITIALIZER; extern void yaz_log_init_globals(void); +#if HAVE_GCRYPT_H +GCRY_THREAD_OPTION_PTHREAD_IMPL; +#endif + void yaz_init_globals(void) { if (yaz_init_flag) @@ -52,6 +57,7 @@ void yaz_init_globals(void) /* most likely, GnuTLS has already initialized libgcrypt */ if (gcry_control(GCRYCTL_ANY_INITIALIZATION_P) == 0) { + gcry_control(GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread); gcry_control(GCRYCTL_INITIALIZATION_FINISHED, NULL, 0); } #endif