os: handle ipc error in server framework

When using the server framework, it might happen that the main thread
tries to forward a signal to the entrypoint, while the context of that
signal is already destroyed. In that case the main thread will get an
ipc error exception as result.

Related to #113
This commit is contained in:
Stefan Kalkowski 2014-02-05 11:56:10 +01:00 committed by Norman Feske
parent 41d5959ae5
commit 0bc012eb79

View File

@ -128,6 +128,15 @@ int main(int argc, char **argv)
constructor_cap.call<Server::Constructor::Rpc_construct>();
/* process incoming signals */
for (;;)
wait_and_dispatch_one_signal(false);
for (;;) {
/*
* It might happen that we try to forward a signal to the entrypoint,
* while the context of that signal is already destroyed. In that case
* we will get an ipc error exception as result, which has to be caught.
*/
try {
wait_and_dispatch_one_signal(false);
} catch(Genode::Ipc_error) { }
}
}