mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-16 06:08:16 +00:00
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:
committed by
Norman Feske
parent
41d5959ae5
commit
0bc012eb79
@ -128,6 +128,15 @@ int main(int argc, char **argv)
|
|||||||
constructor_cap.call<Server::Constructor::Rpc_construct>();
|
constructor_cap.call<Server::Constructor::Rpc_construct>();
|
||||||
|
|
||||||
/* process incoming signals */
|
/* process incoming signals */
|
||||||
for (;;)
|
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);
|
wait_and_dispatch_one_signal(false);
|
||||||
|
} catch(Genode::Ipc_error) { }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user