Wait on working.

Multi-threaded apps can now wait on children to destroy.
WAIT_ON is useful when a child exists with an exit code and the pager
of the child does not want to take the hassle of destorying it via an
ipc. It provides an alternative method of synchronous thread destruction,
where the child destroys itself directly rather than the parent issuing
a destroy on it explicitly.
This commit is contained in:
Bahadir Balban
2009-10-31 23:28:54 +02:00
parent 850c645d77
commit 0f537ea1f5
4 changed files with 38 additions and 26 deletions

View File

@@ -15,8 +15,8 @@
int exit_test_thread(void *arg)
{
l4_thread_switch(0);
l4_exit(0);
//l4_thread_switch(0);
l4_exit(5);
return 0;
}
@@ -46,7 +46,6 @@ int exit_test(void)
#endif
#if 0
/* Wait on it */
printf("Waiting on Thread (%d) to exit.\n", ids.tid);
if ((ret = l4_thread_control(THREAD_WAIT, &ids)) >= 0)
@@ -54,7 +53,6 @@ int exit_test(void)
else
printf("Error. Wait on (%d) failed. err = %d\n",
ids.tid, ret);
#endif
return 0;
out_err: