cli_monitor: make preservation limit a hard limit

When a child requests more ram resources, it gets blocked immediately when
the preservation limit is reached. Otherwise, it might happen that the
cli_monitor runs out of memory.
This commit is contained in:
Stefan Kalkowski 2013-10-18 14:37:22 +02:00 committed by Christian Helmuth
parent e0be6b9ed6
commit 2329184ddb
1 changed files with 5 additions and 2 deletions

View File

@ -112,12 +112,15 @@ class Ram
{
Genode::Lock::Guard guard(_lock);
if (_ram.avail() < (_preserve + amount)) {
Genode::Signal_transmitter(_yield_sigh).submit();
throw Transfer_quota_failed();
}
int const ret = _ram.transfer_quota(to, amount);
if (ret != 0)
throw Transfer_quota_failed();
_validate_preservation();
}
/**