diff options
| author | John Baldwin <jhb@FreeBSD.org> | 2004-09-23 21:03:16 +0000 |
|---|---|---|
| committer | John Baldwin <jhb@FreeBSD.org> | 2004-09-23 21:03:16 +0000 |
| commit | 654e92bf102e55e57619e6b0fdda2e539bae29ff (patch) | |
| tree | 952b39a624387ba352682ee76054135e652f63da /sys/kern/kern_kse.c | |
| parent | 63993cf0114bff2c37062ad55faf095c398d16e4 (diff) | |
Notes
Diffstat (limited to 'sys/kern/kern_kse.c')
| -rw-r--r-- | sys/kern/kern_kse.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/kern/kern_kse.c b/sys/kern/kern_kse.c index 3ecebe9e4395..85732daf2c88 100644 --- a/sys/kern/kern_kse.c +++ b/sys/kern/kern_kse.c @@ -111,6 +111,7 @@ void upcall_remove(struct thread *td) { + mtx_assert(&sched_lock, MA_OWNED); if (td->td_upcall != NULL) { td->td_upcall->ku_owner = NULL; upcall_unlink(td->td_upcall); @@ -653,7 +654,9 @@ kse_create(struct thread *td, struct kse_create_args *uap) * not help performance. */ PROC_LOCK(p); + mtx_lock_spin(&sched_lock); if (newkg->kg_numupcalls >= ncpus) { + mtx_unlock_spin(&sched_lock); PROC_UNLOCK(p); upcall_free(newku); return (EPROCLIM); @@ -675,7 +678,6 @@ kse_create(struct thread *td, struct kse_create_args *uap) * Make the new upcall available to the ksegrp. * It may or may not use it, but it's available. */ - mtx_lock_spin(&sched_lock); PROC_UNLOCK(p); upcall_link(newku, newkg); if (mbx.km_quantum) |
