File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 3232 * 2023-10-17 ChuShicheng Modify the timing of clearing RT_THREAD_STAT_YIELD flag bits
3333 * 2025-08-04 Pillar Add rt_scheduler_critical_switch_flag
3434 * 2025-08-20 RyanCW rt_scheduler_lock_nest use atomic operations
35+ * 2025-09-20 wdfk_prog fix scheduling exception caused by interrupt preemption in rt_schedule
3536 */
3637
3738#define __RT_IPC_SOURCE__
@@ -283,12 +284,13 @@ void rt_schedule(void)
283284 rt_base_t level ;
284285 struct rt_thread * to_thread ;
285286 struct rt_thread * from_thread ;
286- /* using local variable to avoid unecessary function call */
287- struct rt_thread * curr_thread = rt_thread_self ();
288287
289288 /* disable interrupt */
290289 level = rt_hw_interrupt_disable ();
291290
291+ /* using local variable to avoid unecessary function call */
292+ struct rt_thread * curr_thread = rt_thread_self ();
293+
292294 /* check the scheduler is enabled or not */
293295 if (rt_scheduler_lock_nest == 0 )
294296 {
You can’t perform that action at this time.
0 commit comments