From: RĂ©mi Denis-Courmont Date: Mon, 21 Jan 2008 16:15:41 +0000 (+0000) Subject: Remove useless mutex (pthread_once is enough) X-Git-Tag: 0.9.0-test0~3328 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=36d62b40229738ff1bcc1ced472cc06a2e25c686;p=vlc Remove useless mutex (pthread_once is enough) --- diff --git a/libs/srtp/srtp.c b/libs/srtp/srtp.c index 60c07b6f72..e6d09c9732 100644 --- a/libs/srtp/srtp.c +++ b/libs/srtp/srtp.c @@ -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; }