projects
/
pintos-anon
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update.
[pintos-anon]
/
solutions
/
p1-2.patch
diff --git
a/solutions/p1-2.patch
b/solutions/p1-2.patch
index b7e9c798f6674037242d2282e1c9e3cdd09404a5..a2a040d45f5504a02eb15627c552982e9bfa501f 100644
(file)
--- a/
solutions/p1-2.patch
+++ b/
solutions/p1-2.patch
@@
-76,12
+76,12
@@
diff -X pat -urpN pintos.orig/src/threads/thread.c pintos/src/threads/thread.c
/* Stack frame for kernel_thread(). */
kf = alloc_frame (t, sizeof *kf);
/* Stack frame for kernel_thread(). */
kf = alloc_frame (t, sizeof *kf);
-@@ -224,16 +226,3
3
@@ thread_tid (void)
+@@ -224,16 +226,3
4
@@ thread_tid (void)
void
thread_exit (void)
{
+ struct thread *t = thread_current ();
void
thread_exit (void)
{
+ struct thread *t = thread_current ();
-+ list_elem *e;
++ list_elem *e
, *next
;
+
ASSERT (!intr_context ());
+
ASSERT (!intr_context ());
@@
-93,10
+93,11
@@
diff -X pat -urpN pintos.orig/src/threads/thread.c pintos/src/threads/thread.c
+ latch_release (&t->ready_to_die);
+
+ /* Notify our children that they can die. */
+ latch_release (&t->ready_to_die);
+
+ /* Notify our children that they can die. */
-+ for (e = list_begin (&t->children); e != list_end (&t->children);
-+ e = list_next (e))
++ for (e = list_begin (&t->children); e != list_end (&t->children); e = next)
+ {
+ struct thread *child = list_entry (e, struct thread, children_elem);
+ {
+ struct thread *child = list_entry (e, struct thread, children_elem);
++ next = list_next (e);
++ list_remove (e);
+ sema_up (&child->can_die);
+ }
+
+ sema_up (&child->can_die);
+ }
+