base: check result of bind_thread

Related to #1418
Issue #111
This commit is contained in:
Alexander Boettcher 2015-03-13 11:20:44 +01:00 committed by Christian Helmuth
parent c76de84f0a
commit 096d72de90
1 changed files with 7 additions and 1 deletions

View File

@ -55,12 +55,18 @@ void Thread_base::start()
char buf[48];
name(buf, sizeof(buf));
_thread_cap = _cpu_session->create_thread(0, buf, (addr_t)&_context->utcb);
if (!_thread_cap.valid())
throw Cpu_session::Thread_creation_failed();
/* assign thread to protection domain */
env()->pd_session()->bind_thread(_thread_cap);
if (env()->pd_session()->bind_thread(_thread_cap))
throw Cpu_session::Thread_creation_failed();
/* create new pager object and assign it to the new thread */
Pager_capability pager_cap = env()->rm_session()->add_client(_thread_cap);
if (!pager_cap.valid())
throw Cpu_session::Thread_creation_failed();
_cpu_session->set_pager(_thread_cap, pager_cap);
/* register initial IP and SP at core */