From 3283f54c7a0444b2e51ec79a4da57e7871528f05 Mon Sep 17 00:00:00 2001 From: xqyjlj Date: Wed, 25 Oct 2023 20:31:25 +0800 Subject: 🎈 perf: perf rt_hw_interrupt_disable/enable (#8042) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Shell Co-authored-by: Shell --- components/dfs/dfs_v1/src/dfs.c | 4 +++- components/dfs/dfs_v2/src/dfs.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'components/dfs') 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; } -- cgit v1.3.1