summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>2006-12-12 08:01:55 +0000
committerjulian <julian@FreeBSD.org>2006-12-12 08:01:55 +0000
commit541d02c2d4b9d67fcdd0c098260522d9c0708422 (patch)
treed9908d04fd1e327689a8b1b6b1b8d3ec974814d3 /sys
parent229aca463476a9878d74ca11a5da7fd114f5b18e (diff)
downloadFreeBSD-src-541d02c2d4b9d67fcdd0c098260522d9c0708422.zip
FreeBSD-src-541d02c2d4b9d67fcdd0c098260522d9c0708422.tar.gz
Fix a potential point of confusion. Art Ironport we've seen this end up
with an infinite loop in and out of the kernel during process shutdown.
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/kern_kse.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/kern/kern_kse.c b/sys/kern/kern_kse.c
index 4d27d71..8b5f48a 100644
--- a/sys/kern/kern_kse.c
+++ b/sys/kern/kern_kse.c
@@ -372,9 +372,10 @@ kse_exit(struct thread *td, struct kse_exit_args *uap)
thread_unthread(td);
mtx_unlock_spin(&sched_lock);
PROC_UNLOCK(p);
-#if 1
+#if 0
return (0);
#else
+ printf("kse_exit: called on last thread. Calling exit1()");
exit1(td, 0);
#endif
#else /* !KSE */
@@ -403,8 +404,10 @@ kse_release(struct thread *td, struct kse_release_args *uap)
int error;
p = td->td_proc;
- if ((ku = td->td_upcall) == NULL || TD_CAN_UNBIND(td))
- return (EINVAL);
+ if ((ku = td->td_upcall) == NULL || TD_CAN_UNBIND(td)) {
+ printf("kse_release: called outside of threading. exiting");
+ exit1(td, 0);
+ }
if (uap->timeout != NULL) {
if ((error = copyin(uap->timeout, &timeout, sizeof(timeout))))
return (error);
OpenPOWER on IntegriCloud