Commit 36d62b40 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Remove useless mutex (pthread_once is enough)

parent d8cfcc77
......@@ -106,10 +106,8 @@ static int init_libgcrypt (void)
{
int retval;
#ifndef WIN32
static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
static pthread_once_t once = PTHREAD_ONCE_INIT;
pthread_mutex_lock (&mutex);
pthread_once (&once, initonce_libgcrypt);
#else
# warning FIXME: This is not thread-safe.
......@@ -119,10 +117,6 @@ static int init_libgcrypt (void)
retval = libgcrypt_usable ? 0 : -1;
#ifndef WIN32
pthread_mutex_unlock (&mutex);
#endif
return retval;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment