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

Function rt_object_detach

src/object.c:440–459  ·  view source on GitHub ↗

* @brief This function will detach a static object from object system, * and the memory of static object is not freed. * * @param object the specified object to be detached. */

Source from the content-addressed store, hash-verified

438 * @param object the specified object to be detached.
439 */
440void rt_object_detach(rt_object_t object)
441{
442 rt_base_t level;
443 struct rt_object_information *information;
444
445 /* object check */
446 RT_ASSERT(object != RT_NULL);
447
448 RT_OBJECT_HOOK_CALL(rt_object_detach_hook, (object));
449
450 information = rt_object_get_information((enum rt_object_class_type)object->type);
451 RT_ASSERT(information != RT_NULL);
452
453 level = rt_spin_lock_irqsave(&(information->spinlock));
454 /* remove from old list */
455 rt_list_remove(&(object->list));
456 rt_spin_unlock_irqrestore(&(information->spinlock), level);
457
458 object->type = RT_Object_Class_Null;
459}
460
461#ifdef RT_USING_HEAP
462/**

Callers 15

lwp_session_deleteFunction · 0.85
lwp_pgrp_deleteFunction · 0.85
rt_device_unregisterFunction · 0.85
rt_device_destroyFunction · 0.85
pthread_cond_initFunction · 0.85
pthread_mutex_initFunction · 0.85
dfs_ramfs_createFunction · 0.85
dfs_ramfs_createFunction · 0.85
rt_sem_detachFunction · 0.85
rt_mutex_detachFunction · 0.85
rt_event_detachFunction · 0.85

Calls 4

rt_list_removeFunction · 0.85
rt_spin_lock_irqsaveFunction · 0.70

Tested by 4