From 0cb604040a1fc50bba532deec45d945150633fe3 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Mon, 20 Sep 2004 04:29:53 +0000 Subject: [PATCH] Remove `name' from lock because it duplicates its member sema's name. --- src/threads/synch.c | 3 +-- src/threads/synch.h | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) 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. */ }; -- 2.30.2