summaryrefslogtreecommitdiff
path: root/kern/thread.c
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2017-02-28 00:01:06 +0100
committerRichard Braun <rbraun@sceen.net>2017-02-28 00:01:06 +0100
commit5dd82d84251bb021eaedaa9fb43103f5bf52d5b3 (patch)
tree62e129964134387af3f4c350f353e3466b2c8ac8 /kern/thread.c
parentd5228ff3ee479c38f5413953aab4afe51d382050 (diff)
kern/thread: assert wait channels are valid when sleeping
Diffstat (limited to 'kern/thread.c')
-rw-r--r--kern/thread.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/kern/thread.c b/kern/thread.c
index 1631d9a5..741344ba 100644
--- a/kern/thread.c
+++ b/kern/thread.c
@@ -345,6 +345,8 @@ static void
thread_set_wchan(struct thread *thread, const void *wchan_addr,
const char *wchan_desc)
{
+ assert((wchan_addr != NULL) && (wchan_desc != NULL));
+
thread->wchan_addr = wchan_addr;
thread->wchan_desc = wchan_desc;
}
@@ -352,7 +354,8 @@ thread_set_wchan(struct thread *thread, const void *wchan_addr,
static void
thread_clear_wchan(struct thread *thread)
{
- thread_set_wchan(thread, NULL, NULL);
+ thread->wchan_addr = NULL;
+ thread->wchan_desc = NULL;
}
static const struct thread_sched_ops *