MCPcopy Index your code
hub / github.com/RT-Thread/rt-thread / rt_event_delete

Function rt_event_delete

src/ipc.c:1926–1944  ·  view source on GitHub ↗

* @brief This function will delete an event object and release the memory space. * * @note This function is used to delete an event object which is created by the rt_event_create() function. * By contrast, the rt_event_detach() function will detach a static event object. * When the event is successfully deleted, it will resume all suspended threads in the event list.

Source from the content-addressed store, hash-verified

1924 * ONLY USE the rt_event_detach() function to complete the detachment.
1925 */
1926rt_err_t rt_event_delete(rt_event_t event)
1927{
1928 /* parameter check */
1929 RT_ASSERT(event != RT_NULL);
1930 RT_ASSERT(rt_object_get_type(&event->parent.parent) == RT_Object_Class_Event);
1931 RT_ASSERT(rt_object_is_systemobject(&event->parent.parent) == RT_FALSE);
1932
1933 RT_DEBUG_NOT_IN_INTERRUPT;
1934
1935 rt_spin_lock(&(event->spinlock));
1936 /* resume all suspended thread */
1937 rt_susp_list_resume_all(&(event->parent.suspend_thread), RT_ERROR);
1938 rt_spin_unlock(&(event->spinlock));
1939
1940 /* delete event object */
1941 rt_object_delete(&(event->parent.parent));
1942
1943 return RT_EOK;
1944}
1945RTM_EXPORT(rt_event_delete);
1946#endif /* RT_USING_HEAP */
1947

Callers 12

_object_node_deleteFunction · 0.85
sys_event_createFunction · 0.85
dlmodule_destroyFunction · 0.85
utest_tc_cleanupFunction · 0.85
test_tcpFunction · 0.85
test_udpFunction · 0.85
test_event_createFunction · 0.85
test_event_deleteFunction · 0.85
perf_thread_event1Function · 0.85
perf_thread_sem1Function · 0.85
perf_thread_sem2Function · 0.85

Calls 6

rt_object_get_typeFunction · 0.85
rt_susp_list_resume_allFunction · 0.85
rt_object_deleteFunction · 0.85
rt_spin_lockFunction · 0.70
rt_spin_unlockFunction · 0.70

Tested by 5

test_tcpFunction · 0.68
test_udpFunction · 0.68
test_event_createFunction · 0.68
test_event_deleteFunction · 0.68