diff options
author | Federico G. Schwindt <fgsch@cvs.openbsd.org> | 2001-08-21 19:24:54 +0000 |
---|---|---|
committer | Federico G. Schwindt <fgsch@cvs.openbsd.org> | 2001-08-21 19:24:54 +0000 |
commit | 16d25a545116e8f7dfac9140d654821d417a8eba (patch) | |
tree | 3f00c8ca19e17cde8d276fc02cb5f85fa1d8e5f3 /lib/libpthread/uthread/uthread_gc.c | |
parent | 3cfb4c4b00852105397632dba44ff455c6e1cb8f (diff) |
Start syncing with FreeBSD:
o Implement _get_curthread() and _set_curthread(). Use it where possible.
o Add missing _thread_[enter|leave]_cancellation_point().
o Add a couple of not yet used vars to pthread_private.h.
o Remove return's from void functions.
This is by no means complete, but instead of doing a big commit, i'll
split it in small ones, minimizing diffs.
Diffstat (limited to 'lib/libpthread/uthread/uthread_gc.c')
-rw-r--r-- | lib/libpthread/uthread/uthread_gc.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/libpthread/uthread/uthread_gc.c b/lib/libpthread/uthread/uthread_gc.c index 954a09e03df..5f4e520d6aa 100644 --- a/lib/libpthread/uthread/uthread_gc.c +++ b/lib/libpthread/uthread/uthread_gc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uthread_gc.c,v 1.9 2000/01/06 07:17:23 d Exp $ */ +/* $OpenBSD: uthread_gc.c,v 1.10 2001/08/21 19:24:53 fgsch Exp $ */ /* * Copyright (c) 1998 John Birrell <jb@cimlogic.com.au> * All rights reserved. @@ -48,6 +48,7 @@ pthread_addr_t _thread_gc(pthread_addr_t arg) { + struct pthread *curthread = _get_curthread(); int f_debug; int f_done = 0; int ret; @@ -62,13 +63,13 @@ _thread_gc(pthread_addr_t arg) sigprocmask (SIG_BLOCK, &mask, NULL); /* Mark this thread as a library thread (not a user thread). */ - _thread_run->flags |= PTHREAD_FLAGS_PRIVATE; + curthread->flags |= PTHREAD_FLAGS_PRIVATE; /* Set a debug flag based on an environment variable. */ f_debug = (getenv("LIBC_R_DEBUG") != NULL); /* Set the name of this thread. */ - pthread_set_name_np(_thread_run,"GC"); + pthread_set_name_np(curthread,"GC"); while (!f_done) { /* Check if debugging this application. */ @@ -83,8 +84,8 @@ _thread_gc(pthread_addr_t arg) _thread_kern_sig_defer(); /* Check if this is the last running thread: */ - if (TAILQ_FIRST(&_thread_list) == _thread_run && - TAILQ_NEXT(_thread_run, tle) == NULL) + if (TAILQ_FIRST(&_thread_list) == curthread && + TAILQ_NEXT(curthread, tle) == NULL) /* * This is the last thread, so it can exit * now. |