projects
/
pintos-anon
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add comment to clarify behavior.
[pintos-anon]
/
grading
/
threads
/
priority-donate-multiple.c
diff --git
a/grading/threads/priority-donate-multiple.c
b/grading/threads/priority-donate-multiple.c
index 07d9684ed52015940ed3a100bd61b8c9d8586418..a00447e43ac940c4559f8f0974fe9a2cb9293635 100644
(file)
--- a/
grading/threads/priority-donate-multiple.c
+++ b/
grading/threads/priority-donate-multiple.c
@@
-45,21
+45,21
@@
test_donate_multiple (void)
lock_acquire (&b);
thread_create ("a", PRI_DEFAULT + 1, a_thread_func, &a);
lock_acquire (&b);
thread_create ("a", PRI_DEFAULT + 1, a_thread_func, &a);
- printf ("
1.
Main thread should have priority %d. Actual priority: %d.\n",
+ printf ("Main thread should have priority %d. Actual priority: %d.\n",
PRI_DEFAULT + 1, thread_get_priority ());
thread_create ("b", PRI_DEFAULT + 2, b_thread_func, &b);
PRI_DEFAULT + 1, thread_get_priority ());
thread_create ("b", PRI_DEFAULT + 2, b_thread_func, &b);
- printf ("
2.
Main thread should have priority %d. Actual priority: %d.\n",
+ printf ("Main thread should have priority %d. Actual priority: %d.\n",
PRI_DEFAULT + 2, thread_get_priority ());
lock_release (&b);
PRI_DEFAULT + 2, thread_get_priority ());
lock_release (&b);
- printf ("
5.
Thread b should have just finished.\n");
- printf ("
6.
Main thread should have priority %d. Actual priority: %d.\n",
+ printf ("Thread b should have just finished.\n");
+ printf ("Main thread should have priority %d. Actual priority: %d.\n",
PRI_DEFAULT + 1, thread_get_priority ());
lock_release (&a);
PRI_DEFAULT + 1, thread_get_priority ());
lock_release (&a);
- printf ("
9.
Thread a should have just finished.\n");
- printf ("
10.
Main thread should have priority %d. Actual priority: %d.\n",
+ printf ("Thread a should have just finished.\n");
+ printf ("Main thread should have priority %d. Actual priority: %d.\n",
PRI_DEFAULT, thread_get_priority ());
printf ("Multiple priority priority donation test finished.\n");
}
PRI_DEFAULT, thread_get_priority ());
printf ("Multiple priority priority donation test finished.\n");
}
@@
-70,9
+70,9
@@
a_thread_func (void *lock_)
struct lock *lock = lock_;
lock_acquire (lock);
struct lock *lock = lock_;
lock_acquire (lock);
- printf ("
7.
Thread a acquired lock a.\n");
+ printf ("Thread a acquired lock a.\n");
lock_release (lock);
lock_release (lock);
- printf ("
8.
Thread a finished.\n");
+ printf ("Thread a finished.\n");
}
static void
}
static void
@@
-81,7
+81,7
@@
b_thread_func (void *lock_)
struct lock *lock = lock_;
lock_acquire (lock);
struct lock *lock = lock_;
lock_acquire (lock);
- printf ("
3.
Thread b acquired lock b.\n");
+ printf ("Thread b acquired lock b.\n");
lock_release (lock);
lock_release (lock);
- printf ("
4.
Thread b finished.\n");
+ printf ("Thread b finished.\n");
}
}