From 431fc6465d32db324360e947bb55cf972e85cf84 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Tue, 10 Sep 2002 05:53:30 +0000 Subject: Fix some locking problems noted by Manuel. __getgrent() was always called under lock, but the callers did not share the same locks... -Erik --- libc/pwd_grp/getgrnam.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libc/pwd_grp/getgrnam.c') diff --git a/libc/pwd_grp/getgrnam.c b/libc/pwd_grp/getgrnam.c index 10302aab2..2c8d030e0 100644 --- a/libc/pwd_grp/getgrnam.c +++ b/libc/pwd_grp/getgrnam.c @@ -27,9 +27,9 @@ #ifdef __UCLIBC_HAS_THREADS__ #include -static pthread_mutex_t mylock = PTHREAD_MUTEX_INITIALIZER; -# define LOCK pthread_mutex_lock(&mylock) -# define UNLOCK pthread_mutex_unlock(&mylock); +extern pthread_mutex_t __getgrent_lock; +# define LOCK pthread_mutex_lock(&__getgrent_lock) +# define UNLOCK pthread_mutex_unlock(&__getgrent_lock); #else # define LOCK # define UNLOCK -- cgit v1.2.3