summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2016-02-26 01:44:55 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2016-02-26 01:44:55 +0100
commitdef510d20a47ce28f6b8b494f9212f9ee394aae2 (patch)
tree71f8762ab6c02c1f5fe9be4284688436bb5ac546
parente7e91cc329b6a064d9703829911e940d7395d0a3 (diff)
Document why code is not racy
* i386/i386at/kd_mouse.c (kd_mouse_read): Document why the assert_wait/thread_block pair is not racy.
-rw-r--r--i386/i386at/kd_mouse.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/i386/i386at/kd_mouse.c b/i386/i386at/kd_mouse.c
index 0f1881f4..ece13efe 100644
--- a/i386/i386at/kd_mouse.c
+++ b/i386/i386at/kd_mouse.c
@@ -630,6 +630,8 @@ int kd_mouse_read(void)
while (mousebufindex <= mouse_char_index) {
mouse_char_wanted = TRUE;
assert_wait((event_t) &mousebuf, FALSE);
+ /* We are at tty SPL level, interrupts can not happen between
+ * assert_wait and thread_block. */
thread_block((void (*)()) 0);
}