/* Stack frame for kernel_thread(). */
kf = alloc_frame (t, sizeof *kf);
-@@ -224,16 +226,34 @@ thread_tid (void)
+@@ -224,16 +226,33 @@ thread_tid (void)
void
thread_exit (void)
{
+ e = list_next (e))
+ {
+ struct thread *child = list_entry (e, struct thread, children_elem);
-+ list_remove (e);
+ sema_up (&child->can_die);
+ }
+