From 9b1d0f9488c905decaac5269886b137bcd23f416 Mon Sep 17 00:00:00 2001 From: Richard Braun Date: Wed, 20 Sep 2017 20:25:31 +0200 Subject: kern/thread: restore comment about thread destruction --- kern/thread.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kern/thread.c b/kern/thread.c index f9c22742..af11dba5 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); -- cgit v1.2.3