* Increment a reference count on an object. This object should not be\r
* an object's parent.\r
*/\r
-void\r
+int32_t\r
ref_al_obj(\r
IN al_obj_t * const p_obj )\r
{\r
CL_TRACE( AL_DBG_AL_OBJ, g_al_dbg_lvl,\r
("%p(%s)\n", p_obj, ib_get_obj_type( p_obj ) ) );\r
ref_cnt = cl_atomic_inc( &p_obj->ref_cnt );\r
- CL_ASSERT( ref_cnt != 1 );\r
+ CL_ASSERT( ref_cnt != 1 || p_obj->type == AL_OBJ_TYPE_H_CQ );\r
\r
CL_EXIT( AL_DBG_AL_OBJ, g_al_dbg_lvl );\r
+ return ref_cnt;\r
}\r
\r
\r
/*\r
* Increment the reference count on an AL object.\r
*/\r
-void\r
+int32_t\r
ref_al_obj(\r
IN al_obj_t * const p_obj );\r
\r
CL_ASSERT( p_comp_cb_info->cq_context );\r
h_cq = (ib_cq_handle_t)(p_comp_cb_info->cq_context);\r
\r
- ref_al_obj( &h_cq->obj );\r
-\r
- CL_ASSERT( h_cq->pfn_user_comp_cb );\r
- h_cq->pfn_user_comp_cb( h_cq, (void*)h_cq->obj.context );\r
-\r
+ if( ref_al_obj( &h_cq->obj ) > 1 )\r
+ {\r
+ CL_ASSERT( h_cq->pfn_user_comp_cb );\r
+ h_cq->pfn_user_comp_cb( h_cq, (void*)h_cq->obj.context );\r
+ }\r
deref_al_obj( &h_cq->obj );\r
}\r
\r