mirror of
https://github.com/apache/nuttx.git
synced 2026-10-11 16:20:21 +00:00
|
Some checks are pending
MemBrowse Memory Report / changes-filter (push) Waiting to run
MemBrowse Memory Report / load-targets (push) Waiting to run
MemBrowse Memory Report / identical (push) Blocked by required conditions
MemBrowse Memory Report / analyze (push) Blocked by required conditions
When querying the calling task itself (pid == 0 or the caller's own pid), nxsched_get_param() only filled in sched_priority and never touched the SCHED_SPORADIC related members (sched_ss_low_priority, sched_ss_max_repl, sched_ss_repl_period and sched_ss_init_budget). With CONFIG_SCHED_SPORADIC enabled, the caller received uninitialized stack garbage in these fields, and a task running under the sporadic policy could not retrieve its own sporadic parameters. Fix this by factoring the sporadic parameter fill-in into a common helper nxsched_get_sporadic_param() shared by both the self-query and the lookup paths, so both paths now return identical information. The self-query path keeps its original fast-path behavior: no TCB lookup and a lock-free read of sched_priority. Only the read of the sporadic state is wrapped in a critical section, because tcb->sporadic may be freed concurrently, e.g. by sched_setscheduler() from another CPU switching the task away from SCHED_SPORADIC. Signed-off-by: yushuailong <yyyusl@qq.com> |
||
|---|---|---|
| .. | ||
| CMakeLists.txt | ||
| Make.defs | ||
| nxsched_checkstackoverflow.c | ||
| queue.h | ||
| sched.h | ||
| sched_addblocked.c | ||
| sched_addreadytorun.c | ||
| sched_backtrace.c | ||
| sched_cpuload.c | ||
| sched_cpuload_oneshot.c | ||
| sched_cpuload_period.c | ||
| sched_critmonitor.c | ||
| sched_dumponexit.c | ||
| sched_foreach.c | ||
| sched_get_stackinfo.c | ||
| sched_get_stateinfo.c | ||
| sched_get_tls.c | ||
| sched_getaffinity.c | ||
| sched_getcpu.c | ||
| sched_getfiles.c | ||
| sched_getparam.c | ||
| sched_getscheduler.c | ||
| sched_gettcb.c | ||
| sched_idletask.c | ||
| sched_lock.c | ||
| sched_lockcount.c | ||
| sched_mergepending.c | ||
| sched_process_delivered.c | ||
| sched_processtick.c | ||
| sched_processtickless.c | ||
| sched_profil.c | ||
| sched_releasetcb.c | ||
| sched_removeblocked.c | ||
| sched_removereadytorun.c | ||
| sched_reprioritize.c | ||
| sched_reprioritizertr.c | ||
| sched_roundrobin.c | ||
| sched_rrgetinterval.c | ||
| sched_self.c | ||
| sched_setaffinity.c | ||
| sched_setparam.c | ||
| sched_setpriority.c | ||
| sched_setscheduler.c | ||
| sched_sleep.c | ||
| sched_smp.c | ||
| sched_sporadic.c | ||
| sched_suspend.c | ||
| sched_switchcontext.c | ||
| sched_sysinfo.c | ||
| sched_unlock.c | ||
| sched_verifytcb.c | ||
| sched_wait.c | ||
| sched_waitid.c | ||
| sched_waitpid.c | ||
| sched_yield.c | ||