kernel: Use _reschedule() instead of _Swap() where possible
These two spots were duplicating logic that is already done inside _reschedule(), which is the cleaner, less dangerous API. Use it where possible when outside the scheduler internals. Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
This commit is contained in:
parent
dc0713a706
commit
53cae5f471
2 changed files with 2 additions and 12 deletions
|
@ -540,7 +540,7 @@ void _impl_k_thread_suspend(struct k_thread *thread)
|
|||
sys_trace_thread_suspend(thread);
|
||||
|
||||
if (thread == _current) {
|
||||
(void)_Swap(key);
|
||||
_reschedule(key);
|
||||
} else {
|
||||
irq_unlock(key);
|
||||
}
|
||||
|
|
|
@ -37,17 +37,7 @@ void _impl_k_thread_abort(k_tid_t thread)
|
|||
_k_thread_single_abort(thread);
|
||||
_thread_monitor_exit(thread);
|
||||
|
||||
if (_is_in_isr()) {
|
||||
irq_unlock(key);
|
||||
} else {
|
||||
if (_current == thread) {
|
||||
(void)_Swap(key);
|
||||
CODE_UNREACHABLE;
|
||||
}
|
||||
|
||||
/* The abort handler might have altered the ready queue. */
|
||||
_reschedule(key);
|
||||
}
|
||||
_reschedule(key);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue