summaryrefslogtreecommitdiff
path: root/kern/thread.c
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2018-05-14 21:47:27 +0200
committerRichard Braun <rbraun@sceen.net>2018-05-14 21:47:27 +0200
commit16cb249e8ca911ebca4c7b57751f9e95581ca0e9 (patch)
tree1a305ff4e46112fad3e7058f8e0c485e0e76723b /kern/thread.c
parenta06a044cb86860b84dc142b7c88eb87f81f6ff29 (diff)
kern/thread: make thread_create slightly more convenient
Don't require the caller to pass a pointer to the newly created thread.
Diffstat (limited to 'kern/thread.c')
-rw-r--r--kern/thread.c4
1 files changed, 3 insertions, 1 deletions
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);