diff options
Diffstat (limited to 'src/userprog/syscall.c')
| -rw-r--r-- | src/userprog/syscall.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/userprog/syscall.c b/src/userprog/syscall.c index 0df46f4..177cf02 100644 --- a/src/userprog/syscall.c +++ b/src/userprog/syscall.c @@ -69,7 +69,7 @@ get_fd (struct thread *thread, int fd_i) } static void -exit (int status UNUSED) +exit (int status) { struct thread *thread = thread_current (); @@ -83,6 +83,14 @@ exit (int status UNUSED) } free (thread->fds); } + + lock_acquire (&thread->parent->l); + thread->parent->exit_status = status; + lock_release (&thread->parent->l); + + printf("%s: exit(%d)\n", thread->name, status); + + thread_exit (); } static int |
