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

Function rt_mutex_detach

src/ipc.c:1055–1068  ·  view source on GitHub ↗

* @brief This function will detach a static mutex object. * * @note This function is used to detach a static mutex object which is initialized by rt_mutex_init() function. * By contrast, the rt_mutex_delete() function will delete a mutex object. * When the mutex is successfully detached, it will resume all suspended threads in the mutex list. * * @see rt_mutex

Source from the content-addressed store, hash-verified

1053 * ONLY USE the rt_mutex_delete() function to complete the deletion.
1054 */
1055rt_err_t rt_mutex_detach(rt_mutex_t mutex)
1056{
1057 /* parameter check */
1058 RT_ASSERT(mutex != RT_NULL);
1059 RT_ASSERT(rt_object_get_type(&mutex->parent.parent) == RT_Object_Class_Mutex);
1060 RT_ASSERT(rt_object_is_systemobject(&mutex->parent.parent));
1061
1062 _mutex_before_delete_detach(mutex);
1063
1064 /* detach mutex object */
1065 rt_object_detach(&(mutex->parent.parent));
1066
1067 return RT_EOK;
1068}
1069RTM_EXPORT(rt_mutex_detach);
1070
1071/* drop a thread from the suspend list of mutex */

Callers 15

lwp_freeFunction · 0.85
lwp_session_deleteFunction · 0.85
lwp_pgrp_dec_refFunction · 0.85
lwp_tty_deleteFunction · 0.85
rt_pci_ep_unregisterFunction · 0.85
rt_sfud_flash_probe_exFunction · 0.85
rt_sfud_flash_deleteFunction · 0.85
mmcsd_free_hostFunction · 0.85
rt_pipe_deleteFunction · 0.85

Calls 4

rt_object_get_typeFunction · 0.85
rt_object_detachFunction · 0.85

Tested by 10

test_static_mutex_initFunction · 0.68
test_static_mutex_takeFunction · 0.68
test_static_pri_reverseFunction · 0.68
test_recurse_lockFunction · 0.68
test_mutex_piFunction · 0.68
test_mutex_pi_timeoutFunction · 0.68