Implement process_wait.

This commit is contained in:
2024-11-08 03:56:05 +00:00
parent 7349b4e66f
commit fde70dcf59
2 changed files with 72 additions and 9 deletions

View File

@@ -36,9 +36,8 @@ struct process_result
{
tid_t tid; /* The tid of the child process. */
int exit_status; /* The exit status of the child process. Initially set to
-1, then to 0 when parent dies, or to exit_status when
child dies (whichever happens first). */
struct lock lock; /* Lock to synchronise access to the exit_status. */
-1, then to exit_status when child dies. */
struct lock lock; /* Lock to synchronise access to the status and sema. */
struct semaphore sema; /* Semaphore to signal the parent that the exit_status
has been set. */
struct list_elem elem; /* List element for the parent's children list. */