diff options
| author | xqyjlj <[email protected]> | 2023-10-25 20:31:25 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-10-25 20:31:25 +0800 |
| commit | 3283f54c7a0444b2e51ec79a4da57e7871528f05 (patch) | |
| tree | e4bcd748ad2362f16d0dea5c5da62922de466999 /components/dfs | |
| parent | 91fc52df3635d5dda8285616420f08efa79cea04 (diff) | |
🎈 perf: perf rt_hw_interrupt_disable/enable (#8042)
Signed-off-by: Shell <[email protected]>
Co-authored-by: Shell <[email protected]>
Diffstat (limited to 'components/dfs')
| -rw-r--r-- | components/dfs/dfs_v1/src/dfs.c | 4 | ||||
| -rw-r--r-- | components/dfs/dfs_v2/src/dfs.c | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/components/dfs/dfs_v1/src/dfs.c b/components/dfs/dfs_v1/src/dfs.c index 3db9a0bba2..8d2e9b16d3 100644 --- a/components/dfs/dfs_v1/src/dfs.c +++ b/components/dfs/dfs_v1/src/dfs.c @@ -800,11 +800,13 @@ struct dfs_fdtable *dfs_fdtable_get_pid(int pid) struct rt_lwp *lwp = RT_NULL; struct dfs_fdtable *fdt = RT_NULL; - lwp = lwp_from_pid(pid); + lwp_pid_lock_take(); + lwp = lwp_from_pid_locked(pid); if (lwp) { fdt = &lwp->fdt; } + lwp_pid_lock_release(); return fdt; } diff --git a/components/dfs/dfs_v2/src/dfs.c b/components/dfs/dfs_v2/src/dfs.c index d7a5eac002..82a4841bac 100644 --- a/components/dfs/dfs_v2/src/dfs.c +++ b/components/dfs/dfs_v2/src/dfs.c @@ -401,11 +401,13 @@ struct dfs_fdtable *dfs_fdtable_get_pid(int pid) struct rt_lwp *lwp = RT_NULL; struct dfs_fdtable *fdt = RT_NULL; - lwp = lwp_from_pid(pid); + lwp_pid_lock_take(); + lwp = lwp_from_pid_locked(pid); if (lwp) { fdt = &lwp->fdt; } + lwp_pid_lock_release(); return fdt; } |
