summaryrefslogtreecommitdiff
path: root/kern/thread.h
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2018-02-12 21:03:39 +0100
committerRichard Braun <rbraun@sceen.net>2018-02-12 21:03:59 +0100
commitb9cecdff97e290dc919de6bd318e6d6be5ee6d2d (patch)
treec63a3d46864508971c0198b22c28bb54f89bf14b /kern/thread.h
parentc04a26ee892d440979a84b891d6fac14cd4686f1 (diff)
kern/thread: minor changes
Make thread_runq_schedule() slightly more resilient by setting the next thread pointer to NULL after the context switch.
Diffstat (limited to 'kern/thread.h')
-rw-r--r--kern/thread.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/kern/thread.h b/kern/thread.h
index 8084c11..58322bd 100644
--- a/kern/thread.h
+++ b/kern/thread.h
@@ -228,6 +228,8 @@ int thread_timedsleep(struct spinlock *interlock, const void *wchan_addr,
*
* If the target thread is NULL, the calling thread, or already in the
* running state, no action is performed and ERROR_INVAL is returned.
+ *
+ * TODO Describe memory ordering with regard to thread_sleep().
*/
int thread_wakeup(struct thread *thread);
@@ -249,6 +251,8 @@ noreturn void thread_run_scheduler(void);
* This call does nothing if preemption is disabled, or the scheduler
* determines the caller should continue to run (e.g. it's currently the only
* runnable thread).
+ *
+ * Implies a full memory barrier if a context switch occurred.
*/
void thread_yield(void);