From 16cb249e8ca911ebca4c7b57751f9e95581ca0e9 Mon Sep 17 00:00:00 2001 From: Richard Braun Date: Mon, 14 May 2018 21:47:27 +0200 Subject: kern/thread: make thread_create slightly more convenient Don't require the caller to pass a pointer to the newly created thread. --- kern/thread.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'kern/thread.c') diff --git a/kern/thread.c b/kern/thread.c index 85e557d3..e79ef311 100644 --- a/kern/thread.c +++ b/kern/thread.c @@ -2367,7 +2367,9 @@ thread_create(struct thread **threadp, const struct thread_attr *attr, * The new thread address must be written before the thread is started * in case it's passed to it. */ - *threadp = thread; + if (threadp) { + *threadp = thread; + } thread_wakeup(thread); -- cgit v1.2.3