static void internal_node_destroy()

in src/clds_singly_linked_list.c [42:55]


static void internal_node_destroy(CLDS_SINGLY_LINKED_LIST_ITEM* item)
{
    if (interlocked_decrement(&item->ref_count) == 0)
    {
        /* Codes_SRS_CLDS_SINGLY_LINKED_LIST_01_044: [ If item_cleanup_callback is NULL, no user callback shall be triggered for the reclaimed item. ]*/
        if (item->item_cleanup_callback != NULL)
        {
            /* Codes_SRS_CLDS_SINGLY_LINKED_LIST_01_043: [ The reclaim function passed to clds_hazard_pointers_reclaim shall call the user callback item_cleanup_callback that was passed to clds_singly_linked_list_node_create, while passing item_cleanup_callback_context and the freed item as arguments. ]*/
            item->item_cleanup_callback(item->item_cleanup_callback_context, item);
        }

        free((void*)item);
    }
}