Clean up threads.
[pintos-anon] / src / threads / synch.c
index 894c73d0098a04d90c7deba1c81da86272e25e79..b304244176ec6fc32c929bbfd691204370fb541f 100644 (file)
@@ -1,7 +1,6 @@
 #include "synch.h"
 #include "interrupt.h"
 #include "lib.h"
-#include "malloc.h"
 #include "thread.h"
 
 /* One thread in a list. */
@@ -71,8 +70,8 @@ sema_up (struct semaphore *sema)
 
   old_level = intr_disable ();
   if (!list_empty (&sema->waiters)) 
-    thread_ready (list_entry (list_pop_front (&sema->waiters),
-                              struct thread_elem, elem)->thread);
+    thread_wake (list_entry (list_pop_front (&sema->waiters),
+                             struct thread_elem, elem)->thread);
   sema->value++;
   intr_set_level (old_level);
 }