src/kernel/object/object.c
/**
 * @note add a object to object container.
 *       after object add to system manager ,
 *       it`s init function will be invoked automatically
 * @param object
 * @return
 */
@note add a object to object container.
after object add to system manager ,
it`s init function will be invoked automatically
@param object
@return
@note add a object to object container . after object add to system manager it ` s init function will be invoked automatically @param object @return
void object_add(object_t * object){
    object_information_t * information = object_get_information(object->type);
    if (information == NULL){
        return;
    }
    else {
        object->node.next = NULL;
        object->node.data = object;
        base_t level =intrLock_lock(&information->spinlock);
        if(link_find_node_by_data(&information->link,object)==NULL){
            link_add_tail(&information->link, &object->node);
        }
        intrLock_unlock(&information->spinlock,level);
        object->flag = object->flag|OBJECT_FLAG_MANAGED;
    }
}
void object_add ( object_t * object ) { object_information_t * information = object_get_information ( object -> type ) ; if ( information == NULL ) { return ; } else { object -> node . next = NULL ; object -> node . data = object ; base_t level = intrLock_lock ( & information -> spinlock ) ; if ( link_find_node_by_data ( & information -> link , object ) == NULL ) { link_add_tail ( & information -> link , & object -> node ) ; } intrLock_unlock ( & information -> spinlock , level ) ; object -> flag = object -> flag | OBJECT_FLAG_MANAGED ; } }
@note add a object to object container.
@note add a object to object container .
//check if the object is re-add.