X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fthreads%2Fsynch.c;h=ea38068ad017f58888cdf34c9d9f5ce652d4449e;hb=447755c02e674e65801fbb783823009e32458753;hp=c3b46a8c7f675708cacd2d68d0b35c894480c5f6;hpb=9aeade22c073c7a94bc5b56f6c00c0edaeed2b00;p=pintos-anon diff --git a/src/threads/synch.c b/src/threads/synch.c index c3b46a8..ea38068 100644 --- a/src/threads/synch.c +++ b/src/threads/synch.c @@ -40,7 +40,7 @@ sema_init (struct semaphore *sema, unsigned value, const char *name) void sema_down (struct semaphore *sema) { - enum if_level old_level; + enum intr_level old_level; ASSERT (sema != NULL); ASSERT (!intr_context ()); @@ -64,14 +64,14 @@ sema_down (struct semaphore *sema) void sema_up (struct semaphore *sema) { - enum if_level old_level; + enum intr_level old_level; ASSERT (sema != NULL); 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); } @@ -154,7 +154,7 @@ lock_init (struct lock *lock, const char *name) void lock_acquire (struct lock *lock) { - enum if_level old_level; + enum intr_level old_level; ASSERT (lock != NULL); ASSERT (!intr_context ()); @@ -174,7 +174,7 @@ lock_acquire (struct lock *lock) void lock_release (struct lock *lock) { - enum if_level old_level; + enum intr_level old_level; ASSERT (lock != NULL); ASSERT (lock_held_by_current_thread (lock));