mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-18 18:56:29 +00:00
nova: catch exception when leaving thread::entry()
Catch exceptions and try to make a printf. If this also fails, catch it and die causing some noise output in core to detect the situation.
This commit is contained in:
parent
8655b58953
commit
4e47cd2568
@ -36,8 +36,29 @@ using namespace Genode;
|
||||
*/
|
||||
void Thread_base::_thread_start()
|
||||
{
|
||||
Genode::Thread_base::myself()->entry();
|
||||
Thread_base::myself()->_join_lock.unlock();
|
||||
using namespace Genode;
|
||||
|
||||
/* if the inner catch handling fails, let thread die with some noise */
|
||||
try {
|
||||
|
||||
/* catch any exception at this point and try to print a error message */
|
||||
try {
|
||||
Thread_base::myself()->entry();
|
||||
} catch (...) {
|
||||
char thread_name[48];
|
||||
Thread_base::myself()->name(thread_name, sizeof(thread_name));
|
||||
|
||||
PERR("Thread '%s' died because of an uncaught exception", thread_name);
|
||||
}
|
||||
|
||||
Thread_base::myself()->_join_lock.unlock();
|
||||
|
||||
} catch (...) {
|
||||
/* die in a noisy way */
|
||||
nova_die();
|
||||
}
|
||||
|
||||
/* sleep silently */
|
||||
Genode::sleep_forever();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user