summaryrefslogtreecommitdiff
path: root/kern/thread.c
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2017-06-03 14:20:13 +0200
committerRichard Braun <rbraun@sceen.net>2017-06-03 14:20:13 +0200
commit1b902346ce502870329bda19d92d317a21cab56e (patch)
tree45f7d5702e0320047966a1fdd903917730f25627 /kern/thread.c
parent77bb91faa0059b157220ef2e1732bdf89618a375 (diff)
kern/thread: improve thread_wakeup robustness
Diffstat (limited to 'kern/thread.c')
-rw-r--r--kern/thread.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/kern/thread.c b/kern/thread.c
index 17ac10bd..25d81771 100644
--- a/kern/thread.c
+++ b/kern/thread.c
@@ -2452,6 +2452,10 @@ thread_wakeup(struct thread *thread)
struct thread_runq *runq;
unsigned long flags;
+ if ((thread == NULL) || (thread == thread_self())) {
+ return;
+ }
+
/*
* There is at most one reference on threads that were never dispatched,
* in which case there is no need to lock anything.