24 #if GCRYPT_VERSION_NUMBER < 0x010600
29 #define GCRY_THREAD_OPTION_PTHREAD_CPP_IMPL \
30 static int gcry_pthread_mutex_init (void **priv) \
33 pthread_mutex_t *lock = (pthread_mutex_t *)malloc (sizeof (pthread_mutex_t)); \
39 err = pthread_mutex_init (lock, NULL); \
47 static int gcry_pthread_mutex_destroy (void **lock) \
48 { int err = pthread_mutex_destroy ((pthread_mutex_t *)*lock); free (*lock); return err; } \
49 static int gcry_pthread_mutex_lock (void **lock) \
50 { return pthread_mutex_lock ((pthread_mutex_t *)*lock); } \
51 static int gcry_pthread_mutex_unlock (void **lock) \
52 { return pthread_mutex_unlock ((pthread_mutex_t *)*lock); } \
54 static struct gcry_thread_cbs gcry_threads_pthread = \
55 { GCRY_THREAD_OPTION_PTHREAD, NULL, \
56 gcry_pthread_mutex_init, gcry_pthread_mutex_destroy, \
57 gcry_pthread_mutex_lock, gcry_pthread_mutex_unlock }
72 GCRY_THREAD_OPTION_PTHREAD_IMPL;
75 static int initialized = 0;
83 #if GCRYPT_VERSION_NUMBER < 0x010600
84 gcry_control(GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
86 gcry_check_version(NULL);
87 gcry_control(GCRYCTL_DISABLE_SECMEM);
#define GCRY_THREAD_OPTION_PTHREAD_CPP_IMPL