Rbb666 пре 1 месец
родитељ
комит
59528adba8
1 измењених фајлова са 4 додато и 2 уклоњено
  1. 4 2
      src/scheduler_up.c

+ 4 - 2
src/scheduler_up.c

@@ -203,12 +203,14 @@ void rt_schedule(void)
     rt_base_t level;
     struct rt_thread *to_thread;
     struct rt_thread *from_thread;
-    /* using local variable to avoid unecessary function call */
-    struct rt_thread *curr_thread = rt_thread_self();
+    struct rt_thread *curr_thread;
 
     /* disable interrupt */
     level = rt_hw_interrupt_disable();
 
+    /* using local variable to avoid unnecessary function call */
+    curr_thread = rt_thread_self();
+
     /* check the scheduler is enabled or not */
     if (rt_scheduler_lock_nest == 0)
     {