hw: don't use assert in Kernel::bin_thread

ref #1101
This commit is contained in:
Martin Stein 2014-03-17 00:54:00 +01:00 committed by Norman Feske
parent 9e089e7e75
commit dbad6f7061
1 changed files with 10 additions and 7 deletions

View File

@ -334,13 +334,16 @@ void Thread::_call_new_thread()
void Thread::_call_bin_thread() void Thread::_call_bin_thread()
{ {
/* check permissions */ /* check permissions */
assert(_core()); if (!_core()) {
PWRN("not entitled to bin thread");
/* get targeted thread */ return;
unsigned thread_id = (unsigned)user_arg_1(); }
Thread * const thread = Thread::pool()->object(thread_id); /* lookup thread */
assert(thread); Thread * const thread = Thread::pool()->object(user_arg_1());
if (!thread) {
PWRN("failed to lookup thread");
return;
}
/* destroy thread */ /* destroy thread */
thread->~Thread(); thread->~Thread();
} }