From: Ben Pfaff Date: Wed, 22 Sep 2004 00:28:00 +0000 (+0000) Subject: thread_join() the -ex process if THREAD_JOIN_IMPLEMENTED. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3fb471cc28899036990751f18e2ccb83bf897411;p=pintos-anon thread_join() the -ex process if THREAD_JOIN_IMPLEMENTED. --- diff --git a/src/threads/init.c b/src/threads/init.c index 26b9345..855afa0 100644 --- a/src/threads/init.c +++ b/src/threads/init.c @@ -112,8 +112,13 @@ main (void) /* Run a user program. */ if (initial_program != NULL) { + tid_t tid; printf ("\nExecuting '%s':\n", initial_program); - process_execute (initial_program); + tid = process_execute (initial_program); +#ifdef THREAD_JOIN_IMPLEMENTED + if (tid != TID_ERROR) + thread_join (tid); +#endif } #else test ();