diff options
| author | Rbb666 <[email protected]> | 2025-11-15 17:39:13 +0800 |
|---|---|---|
| committer | Rbb666 <[email protected]> | 2025-11-15 17:39:13 +0800 |
| commit | 02b6e1b639ae6d3690c743c5da31eb07859ae208 (patch) | |
| tree | ef29c450fd5ab585fc46a9bbb4924e4c115b7670 | |
| parent | c5f279c82c44e6058c77563e26ef2e339b715c0b (diff) | |
fix patch:#10715v5.2.0-beta
| -rw-r--r-- | src/scheduler_up.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/scheduler_up.c b/src/scheduler_up.c index 95e3cc7fb6..1719dcb995 100644 --- a/src/scheduler_up.c +++ b/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) { |
