projects
/
pintos-anon
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rewrite page allocator to support multi-page allocations.
[pintos-anon]
/
src
/
threads
/
synch.c
diff --git
a/src/threads/synch.c
b/src/threads/synch.c
index be8f0a5a9ad80c7c6dec016987bb23e0aad58d4f..85af57d63ac8c0f59f8b254c0d4db46f495d392b 100644
(file)
--- a/
src/threads/synch.c
+++ b/
src/threads/synch.c
@@
-117,7
+117,7
@@
sema_self_test (void)
printf ("Testing semaphores...");
sema_init (&sema[0], 0, "ping");
sema_init (&sema[1], 0, "pong");
printf ("Testing semaphores...");
sema_init (&sema[0], 0, "ping");
sema_init (&sema[1], 0, "pong");
- 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]);
for (i = 0; i < 10; i++)
{
sema_up (&sema[0]);
@@
-162,7
+162,6
@@
lock_init (struct lock *lock, const char *name)
ASSERT (lock != NULL);
ASSERT (name != NULL);
ASSERT (lock != NULL);
ASSERT (name != NULL);
- strlcpy (lock->name, name, sizeof lock->name);
lock->holder = NULL;
sema_init (&lock->semaphore, 1, name);
}
lock->holder = NULL;
sema_init (&lock->semaphore, 1, name);
}
@@
-226,7
+225,7
@@
lock_name (const struct lock *lock)
{
ASSERT (lock != NULL);
{
ASSERT (lock != NULL);
- return
lock->name
;
+ return
sema_name (&lock->semaphore)
;
}
\f
/* One semaphore in a list. */
}
\f
/* One semaphore in a list. */