diff options
author | jb <jb@FreeBSD.org> | 1998-04-11 07:47:22 +0000 |
---|---|---|
committer | jb <jb@FreeBSD.org> | 1998-04-11 07:47:22 +0000 |
commit | 19185ac5121f9f5c12adb893404acf3e8c9db6d4 (patch) | |
tree | d3cd2f1400e0868d686f6f4a6969a4e33d538f1c /lib/libpthread/thread/thr_create.c | |
parent | 0ff63017b40dda207b2aadc9881e0c93e7fd2753 (diff) | |
download | FreeBSD-src-19185ac5121f9f5c12adb893404acf3e8c9db6d4.zip FreeBSD-src-19185ac5121f9f5c12adb893404acf3e8c9db6d4.tar.gz |
Change the FILE locking to be by FILE, not by the underlying fd as
it was. Add a FILE_WAIT state and queue threads waiting for a FILE
lock. Start using the sys/queue.h macros instead of the way that MIT
pthreads did it.
Add a thread name to the private thread structure and a non-POSIX
function to set this. This helps (me at least) when sending a SIGINFO
to a threaded process to get a /tmp/uthread.dump to see what the
<expletive deleted> threads are doing this time. It is nice to be
able to recognise (yes, I spell that with an 's' too) which threads
are which.
Diffstat (limited to 'lib/libpthread/thread/thr_create.c')
-rw-r--r-- | lib/libpthread/thread/thr_create.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/libpthread/thread/thr_create.c b/lib/libpthread/thread/thr_create.c index 3dcd944..c9c6c9f 100644 --- a/lib/libpthread/thread/thr_create.c +++ b/lib/libpthread/thread/thr_create.c @@ -40,6 +40,7 @@ #include <machine/reg.h> #include <pthread.h> #include "pthread_private.h" +#include "libc_private.h" int _thread_create(pthread_t * thread, const pthread_attr_t * attr, @@ -254,6 +255,12 @@ pthread_create(pthread_t * thread, const pthread_attr_t * attr, int ret = 0; /* + * Locking functions in libc are required when there are + * threads other than the initial thread. + */ + __isthreaded = 1; + + /* * Call the low level thread creation function which allows a parent * thread to be specified: */ |