diff options
author | Alex Auvolat <alex.auvolat@ens.fr> | 2015-03-04 11:54:13 +0100 |
---|---|---|
committer | Alex Auvolat <alex.auvolat@ens.fr> | 2015-03-04 11:54:13 +0100 |
commit | 4cc6defbbd0e7b668b843212e4b5e450266be442 (patch) | |
tree | 74d4c9bb680e7d758d48a2d832ae5da540a955a0 | |
parent | 503f176e001ddf15e6e32bc912cf10b5764bc23b (diff) | |
download | kogata-4cc6defbbd0e7b668b843212e4b5e450266be442.tar.gz kogata-4cc6defbbd0e7b668b843212e4b5e450266be442.zip |
Add previous notice to thread.h
-rw-r--r-- | src/kernel/include/thread.h | 8 |
1 files changed, 8 insertions, 0 deletions
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); |