diff options
-rw-r--r-- | lib/librthread/rthread.c | 4 | ||||
-rw-r--r-- | lib/librthread/rthread.h | 10 | ||||
-rw-r--r-- | lib/librthread/rthread_sched.c | 4 | ||||
-rw-r--r-- | lib/librthread/rthread_sig.c | 8 | ||||
-rw-r--r-- | lib/librthread/rthread_sync.c | 11 |
5 files changed, 17 insertions, 20 deletions
diff --git a/lib/librthread/rthread.c b/lib/librthread/rthread.c index 321c1f86f95..8e027f53d16 100644 --- a/lib/librthread/rthread.c +++ b/lib/librthread/rthread.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rthread.c,v 1.20 2005/12/29 20:34:22 otto Exp $ */ +/* $OpenBSD: rthread.c,v 1.21 2005/12/30 04:05:55 tedu Exp $ */ /* * Copyright (c) 2004,2005 Ted Unangst <tedu@openbsd.org> * All Rights Reserved. @@ -45,8 +45,6 @@ static int concurrency_level; /* not used */ struct pthread _initial_thread __attribute__((__aligned__(16))); -int getthrid(void); -void threxit(int); int rfork_thread(int, void *, void (*)(void *), void *); /* diff --git a/lib/librthread/rthread.h b/lib/librthread/rthread.h index 626daddb49c..a27f0f45b21 100644 --- a/lib/librthread/rthread.h +++ b/lib/librthread/rthread.h @@ -1,4 +1,4 @@ -/* $OpenBSD: rthread.h,v 1.10 2005/12/22 06:49:48 tedu Exp $ */ +/* $OpenBSD: rthread.h,v 1.11 2005/12/30 04:05:55 tedu Exp $ */ /* * Copyright (c) 2004,2005 Ted Unangst <tedu@openbsd.org> * All Rights Reserved. @@ -128,3 +128,11 @@ int _sem_wakeall(sem_t); void _rthread_tls_destructors(pthread_t); int _atomic_lock(register volatile _spinlock_lock_t *); + +/* syscalls */ +int getthrid(void); +void threxit(int); +int thrsleep(void *, int, void *); +int thrwakeup(void *, int n); +int sched_yield(void); +int thrsigdivert(const sigset_t *); diff --git a/lib/librthread/rthread_sched.c b/lib/librthread/rthread_sched.c index 0078c026134..d1dae0867b6 100644 --- a/lib/librthread/rthread_sched.c +++ b/lib/librthread/rthread_sched.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rthread_sched.c,v 1.3 2005/12/19 06:47:40 tedu Exp $ */ +/* $OpenBSD: rthread_sched.c,v 1.4 2005/12/30 04:05:55 tedu Exp $ */ /* * Copyright (c) 2004,2005 Ted Unangst <tedu@openbsd.org> * All Rights Reserved. @@ -36,8 +36,6 @@ #include "rthread.h" -int sched_yield(void); - int pthread_getschedparam(pthread_t thread, int *policy, struct sched_param *param) diff --git a/lib/librthread/rthread_sig.c b/lib/librthread/rthread_sig.c index 4b22e8169aa..def2bd47777 100644 --- a/lib/librthread/rthread_sig.c +++ b/lib/librthread/rthread_sig.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rthread_sig.c,v 1.3 2005/12/19 06:50:13 tedu Exp $ */ +/* $OpenBSD: rthread_sig.c,v 1.4 2005/12/30 04:05:55 tedu Exp $ */ /* * Copyright (c) 2005 Ted Unangst <tedu@openbsd.org> * All Rights Reserved. @@ -36,10 +36,6 @@ #include "rthread.h" -int thrwakeup(void *); -int thrsleep(void *, int, void *); -int thrsigdivert(const sigset_t *); - int pthread_sigmask(int how, const sigset_t *set, sigset_t *oset) { @@ -60,7 +56,7 @@ sigwait_handler(int sig) { pthread_t self = pthread_self(); self->sigpend = sig; - thrwakeup(&self->sigpend); + thrwakeup(&self->sigpend, 0); } typedef void (*sigfn)(int); diff --git a/lib/librthread/rthread_sync.c b/lib/librthread/rthread_sync.c index e5bd30a3635..0353466336d 100644 --- a/lib/librthread/rthread_sync.c +++ b/lib/librthread/rthread_sync.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rthread_sync.c,v 1.13 2005/12/29 11:35:54 otto Exp $ */ +/* $OpenBSD: rthread_sync.c,v 1.14 2005/12/30 04:05:55 tedu Exp $ */ /* * Copyright (c) 2004,2005 Ted Unangst <tedu@openbsd.org> * All Rights Reserved. @@ -38,9 +38,6 @@ #include "rthread.h" -int thrsleep(void *, int, void *); -int thrwakeup(void *); - /* * Internal implementation of semaphores */ @@ -91,7 +88,7 @@ _sem_post(sem_t sem) _spinlock(&sem->lock); sem->value++; if (sem->waitcount) { - thrwakeup(sem); + thrwakeup(sem, 1); rv = 1; } _spinunlock(&sem->lock); @@ -107,7 +104,7 @@ _sem_wakeup(sem_t sem) _spinlock(&sem->lock); if (sem->waitcount) { sem->value++; - thrwakeup(sem); + thrwakeup(sem, 1); rv = 1; } _spinunlock(&sem->lock); @@ -123,7 +120,7 @@ _sem_wakeall(sem_t sem) _spinlock(&sem->lock); rv = sem->waitcount; sem->value += rv; - thrwakeup(sem); + thrwakeup(sem, 0); _spinunlock(&sem->lock); return (rv); |