From 6f7fa17e402e8cc267651b67669f04f70bc80527 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 1 Sep 2000 08:43:17 +0000 Subject: Update. 2000-09-01 Ulrich Drepper * lockfile.c (__flockfile): If _IO_USER_LOCK bit is set don't do anything. (__funlockfile): Likewise. (__ftrylockfile): If _IO_USER_LOCK bit is set return always 0. --- linuxthreads/lockfile.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'linuxthreads/lockfile.c') diff --git a/linuxthreads/lockfile.c b/linuxthreads/lockfile.c index 0ef02f8..a7836b8 100644 --- a/linuxthreads/lockfile.c +++ b/linuxthreads/lockfile.c @@ -29,7 +29,8 @@ void __flockfile (FILE *stream) { #ifdef USE_IN_LIBIO - __pthread_mutex_lock (stream->_lock); + if ((stream->_flags & _IO_USER_LOCK) == 0) + __pthread_mutex_lock (stream->_lock); #else #endif } @@ -44,7 +45,8 @@ void __funlockfile (FILE *stream) { #ifdef USE_IN_LIBIO - __pthread_mutex_unlock (stream->_lock); + if ((stream->_flags & _IO_USER_LOCK) == 0) + __pthread_mutex_unlock (stream->_lock); #else #endif } @@ -59,7 +61,10 @@ int __ftrylockfile (FILE *stream) { #ifdef USE_IN_LIBIO - return __pthread_mutex_trylock (stream->_lock); + if ((stream->_flags & _IO_USER_LOCK) == 0) + return __pthread_mutex_trylock (stream->_lock); + else + return 0; #else #endif } -- cgit v1.1