> The following test program hangs on current from 8/20/2001.
> The program hangs in the fprintf to the function testThread(),
> instead of running to completion. If the call in main to fclose()
> of an unrelated file descriptor is removed the program runs to 
> completion.
> 
> >From tracing code, it appears that fclose.c locks the file, does some stuff,
> and then *tries* to unlock the file.  But while _flockfile is called,
> _funlockfile is *not*.  (The source for fclose.c calls FUNLOCKFILE(fp) -
> don't know where FUNLOCKFILE is defined.)

_funlockfile is called, but fp->_file is -1 so _funlockfile just
returned.  Under RELENG_4, fp->_file is set to -1 after the
FUNLOCKFILE() statement.

A patch for disabling uthread_file.c in the linuxthreads port for
FreeBSD 5.0-CURRENT is enclosed.  This causes the libc version of
_flockfile to be used.

- Tor Egge

? work
Index: files/uthread_file.c
===================================================================
RCS file: /home/ncvs/ports/devel/linuxthreads/files/uthread_file.c,v
retrieving revision 1.3
diff -u -r1.3 uthread_file.c
--- files/uthread_file.c        4 Jan 2000 00:05:22 -0000       1.3
+++ files/uthread_file.c        29 Aug 2001 01:12:32 -0000
@@ -45,6 +45,8 @@
 #include "spinlock.h"
 #include "restart.h"
 
+#if __FreeBSD__ == 4
+
 /*
  * Weak symbols for externally visible functions in this file:
  */
@@ -396,3 +398,5 @@
        }
        _SPINUNLOCK(&hash_lock);
 }
+
+#endif

Reply via email to