diff options
| author | Bernard Xiong <[email protected]> | 2019-04-04 10:58:24 +0800 |
|---|---|---|
| committer | Bernard Xiong <[email protected]> | 2019-04-04 10:58:24 +0800 |
| commit | 0366eb13acd55b5ba676e250366df440776b71d6 (patch) | |
| tree | cc747da88112d5d21bd5e2e02e9cd4b451dbb828 /src | |
| parent | d517389e521f2f2cff4f2a04631a5c952719ce73 (diff) | |
[Kernel] Fix the critical issue when scheduler not start
Diffstat (limited to 'src')
| -rw-r--r-- | src/scheduler.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/scheduler.c b/src/scheduler.c index 0028c98314..be29d9a7e0 100644 --- a/src/scheduler.c +++ b/src/scheduler.c @@ -884,14 +884,17 @@ void rt_exit_critical(void) level = rt_hw_interrupt_disable(); rt_scheduler_lock_nest --; - if (rt_scheduler_lock_nest <= 0) { rt_scheduler_lock_nest = 0; /* enable interrupt */ rt_hw_interrupt_enable(level); - rt_schedule(); + if (rt_current_thread) + { + /* if scheduler is started, do a schedule */ + rt_schedule(); + } } else { |
