mirror of
https://github.com/apache/nuttx.git
synced 2026-09-09 18:36:37 +00:00
sched/environ: Serialize clearenv updates.
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
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
Protect the environment release in clearenv() with the task group mutex. This prevents concurrent environment operations from racing with cleanup. Assisted-by: OpenAI Codex Signed-off-by: yushuailong <yyyusl@qq.com>
This commit is contained in:
parent
69061ea246
commit
dc4c846d32
1 changed files with 6 additions and 2 deletions
|
|
@ -60,9 +60,13 @@
|
|||
int clearenv(void)
|
||||
{
|
||||
FAR struct tcb_s *tcb = this_task();
|
||||
DEBUGASSERT(tcb->group);
|
||||
FAR struct task_group_s *group = tcb->group;
|
||||
|
||||
env_release(tcb->group);
|
||||
DEBUGASSERT(group);
|
||||
|
||||
nxrmutex_lock(&group->tg_mutex);
|
||||
env_release(group);
|
||||
nxrmutex_unlock(&group->tg_mutex);
|
||||
return OK;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue