1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-17 04:52:59 +01:00

Don't evaluate inISR() if not needed

This commit is contained in:
René Kijewski 2014-11-10 07:01:23 +01:00
parent 370f926bad
commit 310ea35018

View File

@ -150,17 +150,16 @@ void sched_set_status(tcb_t *process, unsigned int status)
void sched_switch(uint16_t other_prio)
{
int in_isr = inISR();
tcb_t *active_thread = (tcb_t *) sched_active_thread;
uint16_t current_prio = active_thread->priority;
int on_runqueue = (active_thread->status >= STATUS_ON_RUNQUEUE);
DEBUG("sched_switch: active pid=%" PRIkernel_pid" prio=%" PRIu16 " on_runqueue=%i "
", other_prio=%" PRIu16 " in_isr=%i\n",
active_thread->pid, current_prio, on_runqueue, other_prio, in_isr);
", other_prio=%" PRIu16 "\n",
active_thread->pid, current_prio, on_runqueue, other_prio);
if (!on_runqueue || (current_prio > other_prio)) {
if (in_isr) {
if (inISR()) {
DEBUG("sched_switch: setting sched_context_switch_request.\n");
sched_context_switch_request = 1;
}