summaryrefslogtreecommitdiff
path: root/lib/librthread/rthread_sync.c
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2005-12-30 04:05:56 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2005-12-30 04:05:56 +0000
commit19f8b54848d022d0994f6f79e991f758f0120ad6 (patch)
treedc912c0a271577fcd256bb0d6e45c6bdf22cd696 /lib/librthread/rthread_sync.c
parent388cc63c0cc328888ee5105916d6cf0e2041560e (diff)
prototype all the thread syscalls in rthread.h for now.
update for new thrwakeup that takes a count argument
Diffstat (limited to 'lib/librthread/rthread_sync.c')
-rw-r--r--lib/librthread/rthread_sync.c11
1 files changed, 4 insertions, 7 deletions
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);