]> git.sesse.net Git - vlc/blobdiff - libs/srtp/srtp.c
Remove useless mutex (pthread_once is enough)
[vlc] / libs / srtp / srtp.c
index 60c07b6f72bfa0b7e25eecef27fed0c5aa292ded..e6d09c97325949e082da2d00574bb68b4b9aa40b 100644 (file)
@@ -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;
 
 }