summaryrefslogtreecommitdiffstats
path: root/lib/libpthread/thread/thr_private.h
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/libpthread/thread/thr_private.h
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/libpthread/thread/thr_private.h')
-rw-r--r--lib/libpthread/thread/thr_private.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libpthread/thread/thr_private.h b/lib/libpthread/thread/thr_private.h
index 87bc05a..a554796 100644
--- a/lib/libpthread/thread/thr_private.h
+++ b/lib/libpthread/thread/thr_private.h
@@ -215,6 +215,7 @@ struct kse_group {
struct sched_queue kg_schedq; /* scheduling queue */
struct lock kg_lock;
int kg_threadcount; /* # of assigned threads */
+ int kg_ksecount; /* # of assigned KSEs */
int kg_idle_kses;
int kg_flags;
#define KGF_SINGLE_THREAD 0x0001 /* scope system kse group */
@@ -1023,6 +1024,7 @@ void _kse_single_thread(struct pthread *);
void _kse_start(struct kse *);
int _kse_setthreaded(int);
int _kse_isthreaded(void);
+void _kseg_free(struct kse_group *);
int _mutex_cv_lock(pthread_mutex_t *);
int _mutex_cv_unlock(pthread_mutex_t *);
void _mutex_lock_backout(struct pthread *);
@@ -1060,7 +1062,7 @@ void _thr_lock_wait(struct lock *lock, struct lockuser *lu);
void _thr_lock_wakeup(struct lock *lock, struct lockuser *lu);
int _thr_ref_add(struct pthread *, struct pthread *, int);
void _thr_ref_delete(struct pthread *, struct pthread *);
-void _thr_schedule_add(struct pthread *, struct pthread *);
+int _thr_schedule_add(struct pthread *, struct pthread *);
void _thr_schedule_remove(struct pthread *, struct pthread *);
void _thr_setrunnable(struct pthread *curthread, struct pthread *thread);
void _thr_setrunnable_unlocked(struct pthread *thread);
OpenPOWER on IntegriCloud