core: replenish UTCB quota in exception case

Fixes #4933
This commit is contained in:
Christian Prochaska 2023-06-26 12:09:56 +02:00 committed by Norman Feske
parent ea294fff0c
commit 8264b63e0b

View File

@ -35,6 +35,8 @@ Thread_capability Cpu_session_component::create_thread(Capability<Pd_session> pd
withdraw(Ram_quota{_utcb_quota_size()});
try {
Cpu_thread_component *thread = 0;
if (weight.value == 0) {
@ -85,6 +87,11 @@ Thread_capability Cpu_session_component::create_thread(Capability<Pd_session> pd
_thread_list.insert(thread);
return thread->cap();
} catch (...) {
replenish(Ram_quota{_utcb_quota_size()});
throw;
}
}