ASSERT (lock != NULL);
ASSERT (name != NULL);
- strlcpy (lock->name, name, sizeof lock->name);
lock->holder = NULL;
sema_init (&lock->semaphore, 1, name);
}
{
ASSERT (lock != NULL);
- return lock->name;
+ return sema_name (&lock->semaphore);
}
\f
/* One semaphore in a list. */
/* 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. */
};