%zd -> %zu
[pintos-anon] / src / threads / synch.c
index 169128d8ba62e84e3d6d738a9237988716023bb4..85af57d63ac8c0f59f8b254c0d4db46f495d392b 100644 (file)
@@ -111,14 +111,13 @@ static void sema_test_helper (void *sema_);
 void
 sema_self_test (void) 
 {
-  struct thread *thread;
   struct semaphore sema[2];
   int i;
 
   printf ("Testing semaphores...");
   sema_init (&sema[0], 0, "ping");
   sema_init (&sema[1], 0, "pong");
-  thread = thread_create ("sema-test", sema_test_helper, &sema);
+  thread_create ("sema-test", PRI_DEFAULT, sema_test_helper, &sema);
   for (i = 0; i < 10; i++) 
     {
       sema_up (&sema[0]);
@@ -163,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);
 }
@@ -227,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. */