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()
{
/* check permissions */
assert(_core());
/* get targeted thread */
unsigned thread_id = (unsigned)user_arg_1();
Thread * const thread = Thread::pool()->object(thread_id);
assert(thread);
if (!_core()) {
PWRN("not entitled to bin thread");
return;
}
/* lookup thread */
Thread * const thread = Thread::pool()->object(user_arg_1());
if (!thread) {
PWRN("failed to lookup thread");
return;
}
/* destroy thread */
thread->~Thread();
}