mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-28 09:38:53 +00:00
init: don't block for resource upgrades
If some sessions run out of memory in init, resource requests will be issued to core, which it never will satisfy. Setting some default signal handler avoids that the default implementation will block init for ever. Issue #1632
This commit is contained in:
parent
28223e3146
commit
73f9bb73cd
@ -294,8 +294,11 @@ int main(int, char **)
|
||||
* Signal receiver for config changes
|
||||
*/
|
||||
Signal_receiver sig_rec;
|
||||
Signal_context sig_ctx;
|
||||
config()->sigh(sig_rec.manage(&sig_ctx));
|
||||
Signal_context sig_ctx_config;
|
||||
Signal_context sig_ctx_res_avail;
|
||||
config()->sigh(sig_rec.manage(&sig_ctx_config));
|
||||
/* prevent init to block for resource upgrades (never satisfied by core) */
|
||||
env()->parent()->resource_avail_sigh(sig_rec.manage(&sig_ctx_res_avail));
|
||||
|
||||
for (;;) {
|
||||
|
||||
@ -364,7 +367,13 @@ int main(int, char **)
|
||||
*/
|
||||
|
||||
/* wait for config change */
|
||||
sig_rec.wait_for_signal();
|
||||
while (true) {
|
||||
Signal signal = sig_rec.wait_for_signal();
|
||||
if (signal.context() == &sig_ctx_config)
|
||||
break;
|
||||
|
||||
PWRN("unexpected signal received - drop it");
|
||||
}
|
||||
|
||||
/* kill all currently running children */
|
||||
while (children.any()) {
|
||||
|
Loading…
Reference in New Issue
Block a user