sched: irq: Change this_task to current_task(me) in restore_critical_section()

this_task() is a function call that involves disabling interrupts and this_cpu().
Since restore_critical_section is always called in an interrupt-disabled context,
there's no need to disable interrupts again. Therefore, to save time and achieve
the same effect, I directly call tcb = current_task(me) instead of tcb = this_task().

Signed-off-by: hujun5 <hujun5@xiaomi.com>
This commit is contained in:
hujun5 2024-06-11 08:05:26 +08:00 committed by Masayuki Ishikawa
parent f7843e2198
commit 7db6632ab3

View file

@ -613,13 +613,14 @@ void restore_critical_section(void)
* followed by context switching. * followed by context switching.
*/ */
FAR struct tcb_s *tcb = this_task(); FAR struct tcb_s *tcb;
int me = this_cpu(); int me = this_cpu();
/* Adjust global IRQ controls. If irqcount is greater than zero, /* Adjust global IRQ controls. If irqcount is greater than zero,
* then this task/this CPU holds the IRQ lock * then this task/this CPU holds the IRQ lock
*/ */
tcb = current_task(me);
if (tcb->irqcount > 0) if (tcb->irqcount > 0)
{ {
/* Do notihing here /* Do notihing here