diff options
Diffstat (limited to 'contrib/bind9/lib/bind/resolv/mtctxres.c')
-rw-r--r-- | contrib/bind9/lib/bind/resolv/mtctxres.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/contrib/bind9/lib/bind/resolv/mtctxres.c b/contrib/bind9/lib/bind/resolv/mtctxres.c index f33cf11..635bbd4 100644 --- a/contrib/bind9/lib/bind/resolv/mtctxres.c +++ b/contrib/bind9/lib/bind/resolv/mtctxres.c @@ -106,9 +106,10 @@ ___mtctxres(void) { */ if (!mt_key_initialized) { static pthread_mutex_t keylock = PTHREAD_MUTEX_INITIALIZER; - pthread_mutex_lock(&keylock); - _mtctxres_init(); - pthread_mutex_unlock(&keylock); + if (pthread_mutex_lock(&keylock) == 0) { + _mtctxres_init(); + (void) pthread_mutex_unlock(&keylock); + } } /* |