Rename do_power_off to power_off_when_done.
[pintos-anon] / src / threads / synch.c
index 28696d471aecfc67bfffc243f3734b0dd34a09b2..a892454c8e9adf186c8189173d46c635b15e13e4 100644 (file)
@@ -162,7 +162,6 @@ lock_init (struct lock *lock, const char *name)
   ASSERT (lock != NULL);
   ASSERT (name != NULL);
 
-  strlcpy (lock->name, name, sizeof lock->name);
   lock->holder = NULL;
   sema_init (&lock->semaphore, 1, name);
 }
@@ -226,7 +225,7 @@ lock_name (const struct lock *lock)
 {
   ASSERT (lock != NULL);
 
-  return lock->name;
+  return sema_name (&lock->semaphore);
 }
 \f
 /* One semaphore in a list. */
@@ -251,7 +250,7 @@ cond_init (struct condition *cond, const char *name)
 }
 
 /* Atomically releases LOCK and waits for COND to be signaled by
-   some other piece of code.  After COND is signalled, LOCK is
+   some other piece of code.  After COND is signaled, LOCK is
    reacquired before returning.  LOCK must be held before calling
    this function.
 
@@ -262,7 +261,7 @@ cond_init (struct condition *cond, const char *name)
    again.
 
    A given condition variable is associated with only a single
-   lock, but one lock may be be associated with any number of
+   lock, but one lock may be associated with any number of
    condition variables.  That is, there is a one-to-many mapping
    from locks to condition variables.