summaryrefslogtreecommitdiff
path: root/kern/thread.c
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2017-09-20 20:25:31 +0200
committerRichard Braun <rbraun@sceen.net>2017-09-20 20:25:31 +0200
commit9b1d0f9488c905decaac5269886b137bcd23f416 (patch)
tree4095101d18cfd4d68e64021b23fee791526c960c /kern/thread.c
parente72aa3bba2ab52c4435386e552028ff32ec297af (diff)
kern/thread: restore comment about thread destruction
Diffstat (limited to 'kern/thread.c')
-rw-r--r--kern/thread.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/kern/thread.c b/kern/thread.c
index f9c2274..af11dba 100644
--- a/kern/thread.c
+++ b/kern/thread.c
@@ -2402,6 +2402,11 @@ thread_exit(void)
work_schedule(&zombie.work, 0);
}
+ /*
+ * Disable preemption before dropping the reference, as this may
+ * trigger the active state poll of the join operation. Doing so
+ * keeps the duration of that active wait minimum.
+ */
thread_preempt_disable();
thread_unref(thread);