[uClibc-cvs] uClibc/libc/pwd_grp lckpwdf.c, 1.4, 1.5 pwd_grp.c, 1.4, 1.5

Manuel Novoa III mjn3 at uclibc.org
Sat Dec 27 23:30:43 UTC 2003


Update of /var/cvs/uClibc/libc/pwd_grp
In directory nail:/tmp/cvs-serv11655/libc/pwd_grp

Modified Files:
	lckpwdf.c pwd_grp.c 
Log Message:
Fix a long-standing bug with pthreads.  A couple of linuxthreads files
were including libc-lock.h which had a bunch of weak pragmas.  Also,
uClibc supplied a number of no-op weak thread functions even though
many weren't needed.  This combined result was that sometimes the
functional versions of thread functions in pthread would not override
the weaks in libc.

While fixing this, I also prepended double-underscore to all necessary
weak thread funcs in uClibc, and removed all unused weaks.

I did a test build, but haven't tested this since these changes are
a backport from my working tree.  I did test the changes there and
no longer need to explicitly add -lpthread in the perl build for
perl to pass its thread self tests.



Index: pwd_grp.c
===================================================================
RCS file: /var/cvs/uClibc/libc/pwd_grp/pwd_grp.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- pwd_grp.c	4 Dec 2003 22:57:32 -0000	1.4
+++ pwd_grp.c	27 Dec 2003 23:30:39 -0000	1.5
@@ -445,8 +445,8 @@
 
 #ifdef __UCLIBC_HAS_THREADS__
 static pthread_mutex_t mylock = PTHREAD_MUTEX_INITIALIZER;
-# define LOCK		pthread_mutex_lock(&mylock)
-# define UNLOCK		pthread_mutex_unlock(&mylock);
+# define LOCK		__pthread_mutex_lock(&mylock)
+# define UNLOCK		__pthread_mutex_unlock(&mylock);
 #else       
 # define LOCK		((void) 0)
 # define UNLOCK		((void) 0)
@@ -509,8 +509,8 @@
 
 #ifdef __UCLIBC_HAS_THREADS__
 static pthread_mutex_t mylock = PTHREAD_MUTEX_INITIALIZER;
-# define LOCK		pthread_mutex_lock(&mylock)
-# define UNLOCK		pthread_mutex_unlock(&mylock);
+# define LOCK		__pthread_mutex_lock(&mylock)
+# define UNLOCK		__pthread_mutex_unlock(&mylock);
 #else       
 # define LOCK		((void) 0)
 # define UNLOCK		((void) 0)
@@ -572,8 +572,8 @@
 
 #ifdef __UCLIBC_HAS_THREADS__
 static pthread_mutex_t mylock =  PTHREAD_MUTEX_INITIALIZER;
-# define LOCK		pthread_mutex_lock(&mylock)
-# define UNLOCK		pthread_mutex_unlock(&mylock);
+# define LOCK		__pthread_mutex_lock(&mylock)
+# define UNLOCK		__pthread_mutex_unlock(&mylock);
 #else       
 # define LOCK		((void) 0)
 # define UNLOCK		((void) 0)

Index: lckpwdf.c
===================================================================
RCS file: /var/cvs/uClibc/libc/pwd_grp/lckpwdf.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- lckpwdf.c	10 Oct 2003 07:34:27 -0000	1.4
+++ lckpwdf.c	27 Dec 2003 23:30:39 -0000	1.5
@@ -30,8 +30,8 @@
 #ifdef __UCLIBC_HAS_THREADS__
 #include <pthread.h>
 static pthread_mutex_t mylock = PTHREAD_MUTEX_INITIALIZER;
-# define LOCK   pthread_mutex_lock(&mylock)
-# define UNLOCK pthread_mutex_unlock(&mylock);
+# define LOCK   __pthread_mutex_lock(&mylock)
+# define UNLOCK __pthread_mutex_unlock(&mylock);
 #else       
 # define LOCK
 # define UNLOCK




More information about the uClibc-cvs mailing list