From: Ben Pfaff Date: Mon, 20 Sep 2004 04:29:53 +0000 (+0000) Subject: Remove `name' from lock because it duplicates its member sema's name. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0cb604040a1fc50bba532deec45d945150633fe3;p=pintos-anon Remove `name' from lock because it duplicates its member sema's name. --- diff --git a/src/threads/synch.c b/src/threads/synch.c index 28696d4..85af57d 100644 --- a/src/threads/synch.c +++ b/src/threads/synch.c @@ -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); } /* One semaphore in a list. */ diff --git a/src/threads/synch.h b/src/threads/synch.h index 244479f..ad84238 100644 --- a/src/threads/synch.h +++ b/src/threads/synch.h @@ -21,7 +21,6 @@ void sema_self_test (void); /* Lock. */ struct lock { - char name[16]; /* Name (for debugging purposes only). */ struct thread *holder; /* Thread holding lock (for debugging). */ struct semaphore semaphore; /* Binary semaphore controlling access. */ };