From def510d20a47ce28f6b8b494f9212f9ee394aae2 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Fri, 26 Feb 2016 01:44:55 +0100 Subject: 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. --- i386/i386at/kd_mouse.c | 2 ++ 1 file changed, 2 insertions(+) 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); } -- cgit v1.2.3