[uClibc-cvs] uClibc/libc/stdio stdio.c,1.73,1.74

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


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

Modified Files:
	stdio.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: stdio.c
===================================================================
RCS file: /var/cvs/uClibc/libc/stdio/stdio.c,v
retrieving revision 1.73
retrieving revision 1.74
diff -u -d -r1.73 -r1.74
--- stdio.c	19 Nov 2003 07:21:10 -0000	1.73
+++ stdio.c	27 Dec 2003 23:30:42 -0000	1.74
@@ -193,13 +193,13 @@
 void NAME##_unlocked PARAMS
 
 #define __STDIO_THREADLOCK_OPENLIST \
-	pthread_mutex_lock(&_stdio_openlist_lock)
+	__pthread_mutex_lock(&_stdio_openlist_lock)
 
 #define __STDIO_THREADUNLOCK_OPENLIST \
-	pthread_mutex_unlock(&_stdio_openlist_lock)
+	__pthread_mutex_unlock(&_stdio_openlist_lock)
 
 #define __STDIO_THREADTRYLOCK_OPENLIST \
-	pthread_mutex_trylock(&_stdio_openlist_lock)
+	__pthread_mutex_trylock(&_stdio_openlist_lock)
 
 #endif /* __STDIO_THREADSAFE */
 
@@ -1124,7 +1124,7 @@
 void flockfile(FILE *stream)
 {
 #ifdef __STDIO_THREADSAFE
-	pthread_mutex_lock(&stream->lock);
+	__pthread_mutex_lock(&stream->lock);
 #endif
 }
 
@@ -1135,7 +1135,7 @@
 int ftrylockfile(FILE *stream)
 {
 #ifdef __STDIO_THREADSAFE
-	return pthread_mutex_trylock(&stream->lock);
+	return __pthread_mutex_trylock(&stream->lock);
 #else
 	return 1;
 #endif
@@ -1148,7 +1148,7 @@
 void funlockfile(FILE *stream)
 {
 #ifdef __STDIO_THREADSAFE
-	pthread_mutex_unlock(&stream->lock);
+	__pthread_mutex_unlock(&stream->lock);
 #endif
 }
 




More information about the uClibc-cvs mailing list