Skip to contentSkip to conversation

mini-os: Do not use the same wait element twice

PATCH New Samuel Thibault 1 participant 1 message Apr 4, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mini-os: Do not use the same wait element twice

mini-os: Do not use the same wait element twice

To enqueue the kbdfront thread on two separate wait queues, we need two different wait elements.

extras/mini-os/kernel.c +2 -1
diff -r 8dada4c897c9 extras/mini-os/kernel.c
@@ -353,6 +353,7 @@
 static void kbdfront_thread(void *p)
 {
     DEFINE_WAIT(w);
+    DEFINE_WAIT(w2);
     int x = WIDTH / 2, y = HEIGHT / 2, z = 0;
 
     kbd_dev = init_kbdfront(NULL, 1);
@@ -367,7 +368,7 @@
         int sleep = 1;
 
         add_waiter(w, kbdfront_queue);
-        add_waiter(w, fbfront_queue);
+        add_waiter(w2, fbfront_queue);
 
         while (kbdfront_receive(kbd_dev, &kbdevent, 1) != 0) {
             sleep = 0;