mirror of
https://github.com/genodelabs/genode.git
synced 2025-02-20 17:52:52 +00:00
nova: sanitize priority parameters
threads with prio 0 will not be started and would fail silently. Happened on Turmvilla for the USBProxy thread in virtualbox. Discovered during Turmvilla scenario #1552 and issue #1733.
This commit is contained in:
parent
70a3bb7465
commit
d7da035115
@ -346,6 +346,16 @@ Platform_thread::Platform_thread(const char *name, unsigned prio, int thread_id)
|
||||
_priority(Cpu_session::scale_priority(Nova::Qpd::DEFAULT_PRIORITY, prio))
|
||||
{
|
||||
strncpy(_name, name, sizeof(_name));
|
||||
|
||||
if (_priority == 0) {
|
||||
PWRN("priority of thread '%s' below minimum - boost to 1", _name);
|
||||
_priority = 1;
|
||||
}
|
||||
if (_priority > Nova::Qpd::DEFAULT_PRIORITY) {
|
||||
PWRN("priority of thread '%s' above maximum - limit to %u",
|
||||
_name, Nova::Qpd::DEFAULT_PRIORITY);
|
||||
_priority = Nova::Qpd::DEFAULT_PRIORITY;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user