mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-10-07 00:59:00 +08:00
replace rt_enter_critical with dfs_lock for list_fd
I found that if use mutex in `rt_kprintf`, the `rt_enter_critical` will create a assert error later. after chehcking,I found all operation with fd_table has using `dfs_lock/unlock` to protect. so I think using `dfs_lock` is enough. thanks. Signed-off-by: a1012112796 <1012112796@qq.com>
This commit is contained in:
committed by
Man, Jianting (Meco)
parent
f57eb4feb5
commit
5370d4da50
@@ -529,7 +529,7 @@ int list_fd(void)
|
||||
fd_table = dfs_fdtable_get();
|
||||
if (!fd_table) return -1;
|
||||
|
||||
rt_enter_critical();
|
||||
dfs_lock();
|
||||
|
||||
rt_kprintf("fd type ref magic path\n");
|
||||
rt_kprintf("-- ------ --- ----- ------\n");
|
||||
@@ -562,7 +562,7 @@ int list_fd(void)
|
||||
}
|
||||
}
|
||||
}
|
||||
rt_exit_critical();
|
||||
dfs_unlock();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user