From 4cc6defbbd0e7b668b843212e4b5e450266be442 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Wed, 4 Mar 2015 11:54:13 +0100 Subject: Add previous notice to thread.h --- src/kernel/include/thread.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') diff --git a/src/kernel/include/thread.h b/src/kernel/include/thread.h index 2d385ea..09995fd 100644 --- a/src/kernel/include/thread.h +++ b/src/kernel/include/thread.h @@ -51,6 +51,14 @@ extern thread_t *current_thread; void yield(); void exit(); void usleep(int usecs); + +// Important notice about waiting, resuming and killing : +// Threads may now communicate via wait_on(void* ressource) and resume_on (void* ressource). +// Previous pause() is replaced by wait_on(current_thread) and resume(thread) by resume_on(thread). +// wait_on(x) may return false, indicating that the reason for returning is NOT that resume_on(x) was +// called but something else happenned. Typically false indicates that the curent thread is being +// killed and must terminate its kernel-land processing as soon as possible. + bool wait_on(void* x); // true : resumed normally, false : resumed because thread was killed, or someone else already waiting bool resume_on(void* x); -- cgit v1.2.3