summaryrefslogtreecommitdiffstats
path: root/lib/libkse/thread/thr_cond.c
diff options
context:
space:
mode:
authordeischen <deischen@FreeBSD.org>2003-04-22 20:28:33 +0000
committerdeischen <deischen@FreeBSD.org>2003-04-22 20:28:33 +0000
commit23350dd1f55e20a596f9e469feca743c7fe997ec (patch)
tree19f3d1be5afa27ed30120ee055e1c276564167d9 /lib/libkse/thread/thr_cond.c
parent18f0a39a3fe1da16212e6fc2c570431b6fac7fff (diff)
downloadFreeBSD-src-23350dd1f55e20a596f9e469feca743c7fe997ec.zip
FreeBSD-src-23350dd1f55e20a596f9e469feca743c7fe997ec.tar.gz
Add a couple asserts to pthread_cond_foo to ensure the (low-level)
lock level is 0. Thus far, the threads implementation doesn't use mutexes or condition variables so the lock level should be 0. Save the return value when trying to schedule a new thread and use this to return an error from pthread_create(). Change the max sleep time for an idle KSE to 1 minute from 2 minutes. Maintain a count of the number of KSEs within a KSEG. With these changes scope system threads seem to work, but heavy use of them crash the kernel (supposedly VM bugs).
Diffstat (limited to 'lib/libkse/thread/thr_cond.c')
-rw-r--r--lib/libkse/thread/thr_cond.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/libkse/thread/thr_cond.c b/lib/libkse/thread/thr_cond.c
index c6bffeb..537c264 100644
--- a/lib/libkse/thread/thr_cond.c
+++ b/lib/libkse/thread/thr_cond.c
@@ -373,6 +373,8 @@ _pthread_cond_timedwait(pthread_cond_t * cond, pthread_mutex_t * mutex,
int unlock_mutex = 1;
int seqno;
+ THR_ASSERT(curthread->locklevel == 0,
+ "cv_timedwait: locklevel is not zero!");
_thr_enter_cancellation_point(curthread);
if (abstime == NULL || abstime->tv_sec < 0 || abstime->tv_nsec < 0 ||
@@ -575,6 +577,8 @@ _pthread_cond_signal(pthread_cond_t * cond)
struct pthread *pthread;
int rval = 0;
+ THR_ASSERT(curthread->locklevel == 0,
+ "cv_timedwait: locklevel is not zero!");
if (cond == NULL)
rval = EINVAL;
/*
@@ -632,6 +636,8 @@ _pthread_cond_broadcast(pthread_cond_t * cond)
struct pthread *pthread;
int rval = 0;
+ THR_ASSERT(curthread->locklevel == 0,
+ "cv_timedwait: locklevel is not zero!");
if (cond == NULL)
rval = EINVAL;
/*
OpenPOWER on IntegriCloud