MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / dfs_file_lock

Function dfs_file_lock

components/dfs/dfs_v2/src/dfs.c:196–211  ·  view source on GitHub ↗

* @brief Lock the file descriptor table mutex * * @return rt_err_t RT_EOK if lock acquired successfully, * -RT_ENOSYS if filesystem not initialized, * -RT_EBUSY if mutex is already locked (retries until acquired) * * @note This function will block indefinitely until the lock is acquired. * Should not be called from interrupt service routines. */

Source from the content-addressed store, hash-verified

194 * Should not be called from interrupt service routines.
195 */
196rt_err_t dfs_file_lock(void)
197{
198 rt_err_t result = -RT_EBUSY;
199
200 if (!_dfs_init_ok)
201 {
202 return -RT_ENOSYS;
203 }
204
205 while (result == -RT_EBUSY)
206 {
207 result = rt_mutex_take(&fdlock, RT_WAITING_FOREVER);
208 }
209
210 return result;
211}
212
213/**
214 * @brief Unlock the file descriptor table mutex

Callers 15

on_varea_closeFunction · 0.70
dfs_get_mem_objFunction · 0.70
dfs_vnode_destroyFunction · 0.70
dfs_vnode_unrefFunction · 0.70
fdt_fd_newFunction · 0.70
fdt_fd_associate_fileFunction · 0.70
dfs_fdtable_dupFunction · 0.70
dfs_fdtable_drop_fdFunction · 0.70
dfs_dupFunction · 0.70
dfs_dup_toFunction · 0.70
dfs_dup_fromFunction · 0.70
sys_dup2Function · 0.70

Calls 1

rt_mutex_takeFunction · 0.85

Tested by

no test coverage detected