[uClibc-cvs] uClibc/libc/inet getnetent.c, 1.4, 1.5 getproto.c, 1.5, 1.6 getservice.c, 1.5, 1.6 resolv.c, 1.49, 1.50

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


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

Modified Files:
	getnetent.c getproto.c getservice.c resolv.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: getnetent.c
===================================================================
RCS file: /var/cvs/uClibc/libc/inet/getnetent.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- getnetent.c	17 Jun 2002 21:15:35 -0000	1.4
+++ getnetent.c	27 Dec 2003 23:30:31 -0000	1.5
@@ -25,8 +25,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

Index: getservice.c
===================================================================
RCS file: /var/cvs/uClibc/libc/inet/getservice.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- getservice.c	17 Jun 2002 21:15:35 -0000	1.5
+++ getservice.c	27 Dec 2003 23:30:31 -0000	1.6
@@ -70,8 +70,8 @@
 #ifdef __UCLIBC_HAS_THREADS__
 #include <pthread.h>
 static pthread_mutex_t mylock = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
-# 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

Index: getproto.c
===================================================================
RCS file: /var/cvs/uClibc/libc/inet/getproto.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- getproto.c	27 Jun 2003 07:31:45 -0000	1.5
+++ getproto.c	27 Dec 2003 23:30:31 -0000	1.6
@@ -65,8 +65,8 @@
 #ifdef __UCLIBC_HAS_THREADS__
 #include <pthread.h>
 static pthread_mutex_t mylock = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
-# 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

Index: resolv.c
===================================================================
RCS file: /var/cvs/uClibc/libc/inet/resolv.c,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -d -r1.49 -r1.50
--- resolv.c	19 Oct 2003 00:28:47 -0000	1.49
+++ resolv.c	27 Dec 2003 23:30:31 -0000	1.50
@@ -180,8 +180,8 @@
 #ifdef __UCLIBC_HAS_THREADS__
 #include <pthread.h>
 extern pthread_mutex_t __resolv_lock;
-# define BIGLOCK	pthread_mutex_lock(&__resolv_lock)
-# define BIGUNLOCK	pthread_mutex_unlock(&__resolv_lock);
+# define BIGLOCK	__pthread_mutex_lock(&__resolv_lock)
+# define BIGUNLOCK	__pthread_mutex_unlock(&__resolv_lock);
 #else
 # define BIGLOCK
 # define BIGUNLOCK
@@ -645,8 +645,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
 # define UNLOCK
@@ -1331,8 +1331,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
 # define UNLOCK




More information about the uClibc-cvs mailing list