您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ CL_ASSERT函数代码示例

51自学网 2021-06-01 20:02:29
  C++
这篇教程C++ CL_ASSERT函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中CL_ASSERT函数的典型用法代码示例。如果您正苦于以下问题:C++ CL_ASSERT函数的具体用法?C++ CL_ASSERT怎么用?C++ CL_ASSERT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了CL_ASSERT函数的25个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: cl_qcpool_destroy

void cl_qcpool_destroy(IN cl_qcpool_t * const p_pool){	/* CL_ASSERT that a non-NULL pointer was provided. */	CL_ASSERT(p_pool);	/* CL_ASSERT that we are in a valid state (not uninitialized memory). */	CL_ASSERT(cl_is_state_valid(p_pool->state));	if (p_pool->state == CL_INITIALIZED) {		/*		 * Assert if the user hasn't put everything back in the pool		 * before destroying it		 * if they haven't, then most likely they are still using memory		 * that will be freed, and the destructor will not be called!		 */#ifdef _DEBUG_		/* but we do not want "free" version to assert on this one */		CL_ASSERT(cl_qcpool_count(p_pool) == p_pool->num_objects);#endif		/* call the user's destructor for each object in the pool */		if (p_pool->pfn_dtor) {			while (!cl_is_qlist_empty(&p_pool->free_list)) {				p_pool->pfn_dtor((cl_pool_item_t *)						 cl_qlist_remove_head(&p_pool->								      free_list),						 (void *)p_pool->context);			}		} else {			cl_qlist_remove_all(&p_pool->free_list);		}		/* Free all allocated memory blocks. */		while (!cl_is_qlist_empty(&p_pool->alloc_list))			free(cl_qlist_remove_head(&p_pool->alloc_list));		if (p_pool->component_sizes) {			free(p_pool->component_sizes);			p_pool->component_sizes = NULL;		}	}	p_pool->state = CL_UNINITIALIZED;}
开发者ID:2014-class,项目名称:freerouter,代码行数:42,


示例2: clPyGlueInit

void clPyGlueInit(char* appModule,void (*init_extensions[])(void),int argc, char**argv){  char buf[1024];  ClRcT rc;    Py_Initialize();    PySys_SetArgv(argc, argv);    PyEval_InitThreads();        if (init_extensions)       {        int i = 0;        for(i=0; init_extensions[i]!=NULL; i++) (*init_extensions[i])();      }    thrdState = PyThreadState_Get();    rc = clOsalMutexInit(&pyMutex);    CL_ASSERT(rc==CL_OK);     rc = clOsalCondInit(&event);    CL_ASSERT(rc==CL_OK);     rc = clOsalMutexLock(&pyMutex);    CL_ASSERT(rc==CL_OK);     PyThreadState_Swap(thrdState);    PyRun_SimpleString("import os, os.path, sys/n");    snprintf(buf,1024,"sys.path.append(os.path.realpath('%s'))/n",CL_APP_BINDIR);    clprintf(CL_LOG_SEV_INFO, buf);    PyRun_SimpleString(buf);    //PyRun_SimpleString("sys.path.append(os.path.realpath('../../bin'))/n");    snprintf(buf,1024,"from %s import */n",appModule);    clprintf(CL_LOG_SEV_INFO, buf);    PyRun_SimpleString(buf);    PyThreadState_Swap(NULL);    PyEval_ReleaseLock();    rc=clOsalMutexUnlock(&pyMutex);    CL_ASSERT(rc==CL_OK); }
开发者ID:joaohf,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:42,


示例3: si_rcv_get_fwd_tbl

/********************************************************************** The plock must be held before calling this function.**********************************************************************/static void si_rcv_get_fwd_tbl(IN osm_sm_t * sm, IN osm_switch_t * p_sw){	osm_madw_context_t context;	osm_dr_path_t *p_dr_path;	osm_physp_t *p_physp;	osm_node_t *p_node;	uint32_t block_id_ho;	uint32_t max_block_id_ho;	ib_api_status_t status = IB_SUCCESS;	OSM_LOG_ENTER(sm->p_log);	CL_ASSERT(p_sw);	p_node = p_sw->p_node;	CL_ASSERT(osm_node_get_type(p_node) == IB_NODE_TYPE_SWITCH);	context.lft_context.node_guid = osm_node_get_node_guid(p_node);	context.lft_context.set_method = FALSE;	max_block_id_ho = osm_switch_get_max_block_id_in_use(p_sw);	p_physp = osm_node_get_physp_ptr(p_node, 0);	p_dr_path = osm_physp_get_dr_path_ptr(p_physp);	for (block_id_ho = 0; block_id_ho <= max_block_id_ho; block_id_ho++) {		OSM_LOG(sm->p_log, OSM_LOG_DEBUG,			"Retrieving FT block %u/n", block_id_ho);		status = osm_req_get(sm, p_dr_path, IB_MAD_ATTR_LIN_FWD_TBL,				     cl_hton32(block_id_ho),				     CL_DISP_MSGID_NONE, &context);		if (status != IB_SUCCESS)			/* continue the loop despite the error */			OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 3603: "				"Failure initiating PortInfo request (%s)/n",				ib_get_err_str(status));	}	OSM_LOG_EXIT(sm->p_log);}
开发者ID:ChristianKniep,项目名称:opensm-qnibng,代码行数:45,


示例4: osm_ucast_mgr_destroy

void osm_ucast_mgr_destroy(IN osm_ucast_mgr_t * p_mgr){	CL_ASSERT(p_mgr);	OSM_LOG_ENTER(p_mgr->p_log);	if (p_mgr->cache_valid)		osm_ucast_cache_invalidate(p_mgr);	OSM_LOG_EXIT(p_mgr->p_log);}
开发者ID:FreeBSDFoundation,项目名称:freebsd,代码行数:11,


示例5: clGmsClusterTrackCallbackHandler

/*---------------------------------------------------------------------------- *  Cluster Track Callback Handler *---------------------------------------------------------------------------*/ClRcT clGmsClusterTrackCallbackHandler(    CL_IN   ClGmsClusterTrackCallbackDataT* const res){    ClRcT rc = CL_OK;    struct gms_instance *gms_instance_ptr = NULL;    ClGmsHandleT gmsHandle = CL_GMS_INVALID_HANDLE;    CL_ASSERT(res != NULL);    clLog(INFO,NA,NA,"received cluster track callback");    gmsHandle = res->gmsHandle;    rc = clHandleCheckout(gmsHandleDb, gmsHandle, (void**)&gms_instance_ptr);    if (rc != CL_OK)    {        goto error_free_res;    }    if (gms_instance_ptr == NULL)    {        rc = CL_GMS_RC(CL_ERR_NULL_POINTER);        goto error_free_res;    }    if (gms_instance_ptr->callbacks.clGmsClusterTrackCallback == NULL)    {        rc = CL_GMS_RC(CL_ERR_NO_CALLBACK);        goto error_checkin_free_res;    }    /*     * Calling the user's callback function with the data.  The user cannot     * free the data we provide.  If it needs to reatin it, it has to copy     * it out from what we provide here.     */            (*gms_instance_ptr->callbacks.clGmsClusterTrackCallback)            (gmsHandle, &res->buffer, res->numberOfMembers, res->rc);  error_checkin_free_res:    if (clHandleCheckin(gmsHandleDb, gmsHandle) != CL_OK)    {        clLogError(CLM,NA,                   "/nclHandleCheckin failed");    }error_free_res:    /* Need to free data (res) if are not able to call the actual callback */    if (res->buffer.notification != NULL)    {        clHeapFree((void*)res->buffer.notification);    }    clHeapFree((void*)res);    return rc;}
开发者ID:mrv-communications-pilot,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:57,


示例6: clTransportNotifyRegister

ClRcT clTransportNotifyRegister(ClTransportNotifyCallbackT callback, ClPtrT arg){    ClTransportNotifyRegistrantT *registrant = NULL;    if(!callback) return CL_ERR_INVALID_PARAMETER;    registrant = clHeapCalloc(1, sizeof(*registrant));    CL_ASSERT(registrant != NULL);    registrant->callback = callback;    registrant->arg = arg;    clListAddTail(&registrant->list, &gClXportNotifyRegistrants);    return CL_OK;}
开发者ID:NguyenHoangOC,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:11,


示例7: clMemPartInitialize

ClRcT clMemPartInitialize(ClMemPartHandleT *pMemPartHandle, ClUint32T memPartSize){    ClCharT *pool = NULL;    ClInt32T i;    ClRcT rc = CL_OK;    ClMemPartT *pMemPart = NULL;    if(!pMemPartHandle)        return CL_ERR_INVALID_PARAMETER;    if(!memPartSize)        memPartSize = CL_MEM_PART_SIZE;    pMemPart = calloc(1, sizeof(*pMemPart));    CL_ASSERT(pMemPart !=  NULL);    rc= clOsalMutexInit(&pMemPart->mutex);    CL_ASSERT(rc == CL_OK);    for(i = 0; i < CL_MEM_PART_EXPANSION_SLOTS; ++i)        pMemPart->partitions[i] = NULL;    pMemPart->index = 0;    pool = malloc(memPartSize);    if(!pool)    {        CL_DEBUG_PRINT(CL_DEBUG_ERROR, ("CALLOC failed for size [%d] while trying to create MEM partition/n",                                         memPartSize));        return CL_ERR_NO_MEMORY;    }    pMemPart->partId = memPartCreate(pool, memPartSize);    if(!pMemPart->partId)    {        free(pool);        CL_DEBUG_PRINT(CL_DEBUG_ERROR, ("memPartCreate for size [%d] failed/n", memPartSize));        return CL_ERR_NO_MEMORY;    }    pMemPart->partitions[pMemPart->index++] = pool;    *pMemPartHandle = (ClMemPartHandleT)pMemPart;    return CL_OK;}
开发者ID:NguyenHoangOC,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:41,


示例8: cycle_exists

static int cycle_exists(cdg_vertex_t * start, cdg_vertex_t * current,			cdg_vertex_t * prev, int visit_num){	int i, new_visit_num;	int cycle_found = 0;	if (current != NULL && current->visiting_number > 0) {		if (visit_num > current->visiting_number && current->seen == 0) {			cycle_found = 1;		}	} else {		if (current == NULL) {			current = start;			CL_ASSERT(prev == NULL);		}		current->visiting_number = visit_num;		if (prev != NULL) {			prev->next = current;			CL_ASSERT(prev->to == current->from);			CL_ASSERT(prev->visiting_number > 0);		}		new_visit_num = visit_num + 1;		for (i = 0; i < current->num_deps; i++) {			cycle_found =			    cycle_exists(start, current->deps[i].v, current,					 new_visit_num);			if (cycle_found == 1)				i = current->num_deps;		}		current->seen = 1;		if (prev != NULL)			prev->next = NULL;	}	return cycle_found;}
开发者ID:FreeBSDFoundation,项目名称:freebsd,代码行数:41,


示例9: clEsmInstanceRestart

/** *  ReStarts the extended state machine instance. * *  Please refer to the FSM Restart API. * *  @param smThis State Machine Object * *  @returns  *    CL_OK on CL_OK (successful start) <br/> *    CL_SM_RC(CL_ERR_NULL_POINTER) on invalid/null instance handle <br/> * *  @see #clSmInstanceStart */ClRcTclEsmInstanceRestart(ClExSmInstancePtrT smThis                  ){    CL_ASSERT(smThis);    if(smThis)      {        return clSmInstanceRestart(smThis->fsm);      }        return CL_SM_RC(CL_ERR_NULL_POINTER);}
开发者ID:joaohf,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:25,


示例10: clEoQueueStatsStop

void clEoQueueStatsStop(ClUint32T queueSize, ClEoJobT *pJob, ClEoQueueStatsT *pStats){    ClUint8T proto = pJob->msgParam.protoType;    ClUint8T priority = CL_EO_RECV_QUEUE_PRI(pJob->msgParam);    ClUint64T timeDiff=0;    gettimeofday(&pStats->end, NULL);    CL_ASSERT(pStats->priority == priority);    CL_ASSERT(pStats->proto == proto);    pStats->end.tv_sec -= pStats->start.tv_sec;    pStats->end.tv_usec -= pStats->start.tv_usec;    if(pStats->end.tv_sec < 0)        pStats->end.tv_sec = 0, pStats->end.tv_usec = 0;    else if(pStats->end.tv_usec < 0)    {        --pStats->end.tv_sec;        pStats->end.tv_usec += 1000000L;    }    timeDiff = (ClUint64T)pStats->end.tv_sec*1000000L + pStats->end.tv_usec;    pStats->totalTime = timeDiff;    clEoQueueStatsUpdate(pStats);}
开发者ID:NguyenHoangOC,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:21,


示例11: __osm_set_wrid_by_p_madw

/*  Since a race can accure on requests. Meaning - a response is received before  the send_callback is called - we will save both the madw_p and the fact  whether or not it is a response. A race can occure only on requests that did  not fail, and then the madw_p will be put back in the pool before the  callback.*/uint64_t __osm_set_wrid_by_p_madw(IN osm_madw_t * p_madw){	uint64_t wrid = 0;	CL_ASSERT(p_madw->p_mad);	memcpy(&wrid, &p_madw, sizeof(osm_madw_t *));	wrid = (wrid << 1) |	    ib_mad_is_response(p_madw->p_mad) |	    (p_madw->p_mad->method == IB_MAD_METHOD_TRAP_REPRESS);	return wrid;}
开发者ID:2014-class,项目名称:freerouter,代码行数:19,


示例12: osm_nd_rcv_process

void osm_nd_rcv_process(IN void *context, IN void *data){	osm_sm_t *sm = context;	osm_madw_t *p_madw = data;	ib_node_desc_t *p_nd;	ib_smp_t *p_smp;	osm_node_t *p_node;	ib_net64_t node_guid;	CL_ASSERT(sm);	OSM_LOG_ENTER(sm->p_log);	CL_ASSERT(p_madw);	p_smp = osm_madw_get_smp_ptr(p_madw);	if (ib_smp_get_status(p_smp)) {		OSM_LOG(sm->p_log, OSM_LOG_DEBUG,			"MAD status 0x%x received/n",			cl_ntoh16(ib_smp_get_status(p_smp)));		goto Exit;	}	p_nd = ib_smp_get_payload_ptr(p_smp);	/* Acquire the node object and add the node description. */	node_guid = osm_madw_get_nd_context_ptr(p_madw)->node_guid;	CL_PLOCK_EXCL_ACQUIRE(sm->p_lock);	p_node = osm_get_node_by_guid(sm->p_subn, node_guid);	if (!p_node)		OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 0B01: "			"NodeDescription received for nonexistent node "			"0x%" PRIx64 "/n", cl_ntoh64(node_guid));	else		nd_rcv_process_nd(sm, p_node, p_nd);	CL_PLOCK_RELEASE(sm->p_lock);Exit:	OSM_LOG_EXIT(sm->p_log);}
开发者ID:FreeBSDFoundation,项目名称:freebsd,代码行数:40,


示例13: CL_ASSERT

osm_madw_t *osm_mad_pool_get(IN osm_mad_pool_t * const p_pool,                             IN osm_bind_handle_t h_bind,                             IN const uint32_t total_size,                             IN const osm_mad_addr_t * const p_mad_addr){    osm_madw_t *p_madw;    ib_mad_t *p_mad;    CL_ASSERT(h_bind != OSM_BIND_INVALID_HANDLE);    CL_ASSERT(total_size);    /*       First, acquire a mad wrapper from the mad wrapper pool.     */    p_madw = malloc(sizeof(*p_madw));    if (p_madw == NULL)        goto Exit;    osm_madw_init(p_madw, h_bind, total_size, p_mad_addr);    /*       Next, acquire a wire mad of the specified size.     */    p_mad = osm_vendor_get(h_bind, total_size, &p_madw->vend_wrap);    if (p_mad == NULL) {        /* Don't leak wrappers! */        free(p_madw);        p_madw = NULL;        goto Exit;    }    cl_atomic_inc(&p_pool->mads_out);    /*       Finally, attach the wire MAD to this wrapper.     */    osm_madw_set_mad(p_madw, p_mad);Exit:    return p_madw;}
开发者ID:cyrilmagsuci,项目名称:freebsd,代码行数:40,


示例14: __osmv_txnmgr_lookup

ib_api_status_t__osmv_txnmgr_lookup(IN osmv_txn_mgr_t * p_tx_mgr,		     IN uint64_t key, OUT osmv_txn_ctx_t ** pp_txn){	ib_api_status_t status = IB_SUCCESS;	cl_map_item_t *p_item;	cl_map_obj_t *p_obj;	uint64_t tmp_key;	OSM_LOG_ENTER(p_tx_mgr->p_log);	CL_ASSERT(p_tx_mgr);	CL_ASSERT(pp_txn);	osm_log(p_tx_mgr->p_log, OSM_LOG_DEBUG,		"__osmv_txnmgr_lookup: "		"Looking for key: 0x%llX in map ptr:%p/n", key,		p_tx_mgr->p_txn_map);	p_item = cl_qmap_head(p_tx_mgr->p_txn_map);	while (p_item != cl_qmap_end(p_tx_mgr->p_txn_map)) {		tmp_key = cl_qmap_key(p_item);		osm_log(p_tx_mgr->p_log, OSM_LOG_DEBUG,			"__osmv_txnmgr_lookup: "			"Found key 0x%llX /n", tmp_key);		p_item = cl_qmap_next(p_item);	}	p_item = cl_qmap_get(p_tx_mgr->p_txn_map, key);	if (cl_qmap_end(p_tx_mgr->p_txn_map) == p_item) {		status = IB_NOT_FOUND;	} else {		p_obj = PARENT_STRUCT(p_item, cl_map_obj_t, item);		*pp_txn = cl_qmap_obj(p_obj);	}	OSM_LOG_EXIT(p_tx_mgr->p_log);	return status;}
开发者ID:2014-class,项目名称:freerouter,代码行数:40,


示例15: clDispatchSelectionObjectGet

/*  * clDispatchSelectionObject returns the selection object [readFd] associated * with this particular initialization of the dispatch library  */ClRcT   clDispatchSelectionObjectGet(        CL_IN   ClHandleT           dispatchHandle,        CL_OUT  ClSelectionObjectT* pSelectionObject){    ClRcT   rc = CL_OK;    ClDispatchDbEntryT* thisDbEntry = NULL;    if (pSelectionObject == NULL)    {        return CL_ERR_NULL_POINTER;    }    CHECK_LIB_INIT;    rc = clHandleCheckout(databaseHandle, dispatchHandle, (void *)&thisDbEntry);    if (rc != CL_OK)    {        return CL_ERR_INVALID_HANDLE;    }    CL_ASSERT(thisDbEntry != NULL);    rc = clOsalMutexLock(thisDbEntry->dispatchMutex);    if (rc != CL_OK)    {        goto error_return;    }    if (thisDbEntry->shouldDelete == CL_TRUE)    {        rc = CL_ERR_INVALID_HANDLE;        goto error_unlock_return;    }        *pSelectionObject = (ClSelectionObjectT)thisDbEntry->readFd;error_unlock_return:    rc = clOsalMutexUnlock(thisDbEntry->dispatchMutex);    if (rc != CL_OK)    {        CL_DEBUG_PRINT(CL_DEBUG_ERROR,                ("Mutex Unlock failed with rc = 0x%x/n",rc));    }error_return:    if ((clHandleCheckin(databaseHandle, dispatchHandle)) != CL_OK)    {        CL_DEBUG_PRINT(CL_DEBUG_ERROR,                ("clHandleCheckin failed"));    }    return rc;}
开发者ID:NguyenHoangOC,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:56,


示例16: clPyGlueStart

void clPyGlueStart(int block){    ClRcT rc;    clRunPython("eoApp.Start()");    if (block)      {      ClTimerTimeOutT forever={0};      rc = clOsalMutexLock(&pyMutex);      CL_ASSERT(rc==CL_OK);       clOsalCondWait (&event,&pyMutex,forever);      }}
开发者ID:joaohf,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:13,


示例17: clAmsMgmtOIExtendedCacheAdd

static void clAmsMgmtOIExtendedCacheAdd(ClAmsMgmtOIExtendedClassTypeT type,                                        ClCorInstanceIdT instance,                                         ClAmsMgmtOIExtendedEntityConfigT *pConfig,                                        ClUint32T configSize){    struct hashStruct **table = NULL;    ClAmsMgmtOIExtendedCacheT *cacheEntry = NULL;    if(type >= CL_AMS_MGMT_OI_EXTENDED_CLASS_MAX || !pConfig || !configSize)        return;    clOsalMutexLock(&gClAmsMgmtOICacheMutex);    table = gClAmsMgmtOIExtendedCacheTable[type];    if( (cacheEntry = clAmsMgmtOIExtendedCacheFind(table, instance) ) )    {        CL_ASSERT(cacheEntry->pConfig != NULL);        if(cacheEntry->configSize != configSize)        {            clHeapFree(cacheEntry->pConfig);            cacheEntry->pConfig = clHeapCalloc(1, configSize);            CL_ASSERT(cacheEntry->pConfig != NULL);            cacheEntry->configSize = configSize;        }        memcpy(cacheEntry->pConfig, pConfig, configSize);    }    else    {        ClAmsMgmtOIExtendedEntityConfigT *pExtendedConfig = NULL;        cacheEntry = clHeapCalloc(1, sizeof(*cacheEntry));        CL_ASSERT(cacheEntry != NULL);        pExtendedConfig = clHeapCalloc(1, configSize);        CL_ASSERT(pExtendedConfig != NULL);        cacheEntry->pConfig = pExtendedConfig;        cacheEntry->instance = instance;        memcpy(cacheEntry->pConfig, pConfig, configSize);        hashAdd(table, entityCacheHashKey(instance), &cacheEntry->hash);        clLogNotice("AMF", "MGMT", "Added entity [%s], instance [%d] to the extended class [%s]",                    pConfig->entity.name.value, instance, gClAmsMgmtOIExtendedCacheStrTable[type]);    }    clOsalMutexUnlock(&gClAmsMgmtOICacheMutex);}
开发者ID:joaohf,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:39,


示例18: osm_vendor_bind

osm_bind_handle_tosm_vendor_bind(IN osm_vendor_t * const p_vend,		IN osm_bind_info_t * const p_bind_info,		IN osm_mad_pool_t * const p_mad_pool,		IN osm_vend_mad_recv_callback_t mad_recv_callback,		IN void *context){	osm_bind_handle_t h_bind;	OSM_LOG_ENTER(p_vend->p_log);	CL_ASSERT(p_vend);	CL_ASSERT(p_bind_info);	CL_ASSERT(p_mad_pool);	CL_ASSERT(mad_recv_callback);	CL_ASSERT(context);	UNUSED_PARAM(p_vend);	UNUSED_PARAM(p_mad_pool);	UNUSED_PARAM(mad_recv_callback);	UNUSED_PARAM(context);	h_bind = (osm_bind_handle_t) malloc(sizeof(*h_bind));	if (h_bind != NULL) {		memset(h_bind, 0, sizeof(*h_bind));		h_bind->p_vend = p_vend;		h_bind->port_guid = p_bind_info->port_guid;		h_bind->mad_class = p_bind_info->mad_class;		h_bind->class_version = p_bind_info->class_version;		h_bind->is_responder = p_bind_info->is_responder;		h_bind->is_trap_processor = p_bind_info->is_trap_processor;		h_bind->is_report_processor = p_bind_info->is_report_processor;		h_bind->send_q_size = p_bind_info->send_q_size;		h_bind->recv_q_size = p_bind_info->recv_q_size;	}	OSM_LOG_EXIT(p_vend->p_log);	return (h_bind);}
开发者ID:ChristianKniep,项目名称:opensm-qnibng,代码行数:39,


示例19: alarmClockCkptInitialize

/*******************************************************************************Feature API: alarmClockCkptInitialize*******************************************************************************/SaAisErrorTalarmClockCkptInitialize (void){    SaAisErrorT  ret_code = SA_AIS_OK;    if (ckpt_svc_hdl == 0)    {        ret_code = saCkptInitialize(&ckpt_svc_hdl, NULL, &ckpt_version);            if (ret_code != SA_AIS_OK)        {            alarmClockLogWrite(CL_LOG_SEV_ERROR,                    "alarmClockCkptInitialize(pid=%d): Failed %x/n",                     getpid(), ret_code);        }    }        sessionInit();    ClRcT rc = clOsalMutexInit(&alarmClockCkptMutex);    CL_ASSERT(rc == CL_OK);    ioVecs = clHeapCalloc(MAX_NUM_IOVECS, sizeof(*ioVecs));    CL_ASSERT(ioVecs != NULL);    return ret_code;}
开发者ID:dharamjhatakia,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:26,


示例20: clGmsClusterMemberEjectCallbackHandler

/*---------------------------------------------------------------------------- *  Cluster Member Eject Callback Handler *---------------------------------------------------------------------------*/ClRcT clGmsClusterMemberEjectCallbackHandler(    CL_IN   ClGmsClusterMemberEjectCallbackDataT* const res){    ClRcT rc = CL_OK;    struct gms_instance *gms_instance_ptr = NULL;    ClGmsHandleT gmsHandle = CL_GMS_INVALID_HANDLE;        CL_ASSERT(res != NULL);        gmsHandle = res->gmsHandle;    rc = clHandleCheckout(gmsHandleDb, gmsHandle, (void**)&gms_instance_ptr);    if (rc != CL_OK)    {        goto error_free_res;    }    if (gms_instance_ptr == NULL)    {        rc = CL_GMS_RC(CL_ERR_NULL_POINTER);        goto error_free_res;    }        if (gms_instance_ptr->                cluster_manage_callbacks.clGmsMemberEjectCallback == NULL)    {        rc = CL_GMS_RC(CL_ERR_NO_CALLBACK);        goto error_checkin_free_res;    }        /*     * Calling the user's callback function with the data.  The user cannot     * free the data we provide.  If it needs to reatin it, it has to copy     * it out from what we provide here.     */    (*gms_instance_ptr->cluster_manage_callbacks.clGmsMemberEjectCallback)                               (res->reason);     error_checkin_free_res:    if (clHandleCheckin(gmsHandleDb, gmsHandle))    {        clLogError(CLM,NA,                   "/nclHandleCheckin failed");    }error_free_res:    clHeapFree((void*)res);        return rc;}
开发者ID:mrv-communications-pilot,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:54,


示例21: __cl_pool_init_cb

/* * Callback to translate quick composite to grow pool constructor callback. */static cl_status_t__cl_pool_init_cb(IN void **const pp_obj,		  IN const uint32_t count,		  IN void *const context,		  OUT cl_pool_item_t ** const pp_pool_item){	cl_pool_t *p_pool = (cl_pool_t *) context;	cl_pool_obj_t *p_pool_obj;	cl_status_t status = CL_SUCCESS;	CL_ASSERT(p_pool);	CL_ASSERT(pp_obj);	CL_ASSERT(count == 1);	UNUSED_PARAM(count);	/*	 * Set our pointer to the list item, which is stored at the beginning of	 * the first component.	 */	p_pool_obj = (cl_pool_obj_t *) * pp_obj;	*pp_pool_item = &p_pool_obj->pool_item;	/* Calculate the pointer to the user's first component. */	*pp_obj = ((uint8_t *) * pp_obj) + sizeof(cl_pool_obj_t);	/*	 * Set the object pointer in the pool item to point to the first of the	 * user's components.	 */	p_pool_obj->p_object = *pp_obj;	/* Invoke the user's constructor callback. */	if (p_pool->pfn_init)		status = p_pool->pfn_init(*pp_obj, (void *)p_pool->context);	return (status);}
开发者ID:2014-class,项目名称:freerouter,代码行数:41,


示例22: osm_vendor_put

/* //////////////////////////////////////////////////////////////////////// */voidosm_vendor_put(IN osm_bind_handle_t h_bind,	       IN osm_vend_wrap_t * const p_vend_wrap,	       IN ib_mad_t * const p_mad){	FSTATUS Status;	mad_bind_info_t *p_mad_bind_info;	umadt_obj_t *p_umadt_obj;	/*  */	/*  Validate the vendor mad transport handle */	/*  */	CL_ASSERT(h_bind);	p_mad_bind_info = (mad_bind_info_t *) h_bind;	p_umadt_obj = p_mad_bind_info->p_umadt_obj;	/*  sanity check */	CL_ASSERT(p_umadt_obj->init_done);	CL_ASSERT(h_bind);	CL_ASSERT(__valid_mad_handle(p_mad_bind_info));	CL_ASSERT(p_vend_wrap);	/* CL_ASSERT( (ib_mad_t*)&p_vend_wrap->p_madt_struct->IBMad == p_mad ); */	/*  Release the MAD based on the direction of the MAD */	if (p_vend_wrap->direction == SEND) {		/*  */		/* For a send the PostSend released the MAD with Umadt. Simply dealloacte the */		/* local memory that was allocated on the osm_vendor_get() call. */		/*  */		free(p_mad);#if 0		Status =		    p_umadt_obj->uMadtInterface.		    uMadtReleaseSendMad(p_mad_bind_info->umadt_handle,					p_vend_wrap->p_madt_struct);		if (Status != FSUCCESS) {			/* printf("uMadtReleaseSendMad: Status  = <%d>/n", Status); */			return;		}#endif	} else if (p_vend_wrap->direction == RECEIVE) {		CL_ASSERT((ib_mad_t *) & p_vend_wrap->p_madt_struct->IBMad ==			  p_mad);		Status =		    p_umadt_obj->uMadtInterface.		    uMadtReleaseRecvMad(p_mad_bind_info->umadt_handle,					p_vend_wrap->p_madt_struct);		if (Status != FSUCCESS) {			/* printf("uMadtReleaseRecvMad Status=<%d>/n", Status); */			return;		}	} else {		return;	}	return;}
开发者ID:2014-class,项目名称:freerouter,代码行数:59,


示例23: __osmv_txnmgr_insert_txn

ib_api_status_t__osmv_txnmgr_insert_txn(IN osmv_txn_mgr_t * p_tx_mgr,			 IN osmv_txn_ctx_t * p_txn, IN uint64_t key){	cl_map_obj_t *p_obj = NULL;	cl_map_item_t *p_item;	uint64_t tmp_key;	CL_ASSERT(p_tx_mgr);	CL_ASSERT(p_txn);	key = osmv_txn_get_key(p_txn);	p_obj = malloc(sizeof(cl_map_obj_t));	if (NULL == p_obj)		return IB_INSUFFICIENT_MEMORY;	osm_log(p_tx_mgr->p_log, OSM_LOG_DEBUG,		"__osmv_txnmgr_insert_txn: "		"Inserting key: 0x%llX to map ptr:%p/n", key,		p_tx_mgr->p_txn_map);	memset(p_obj, 0, sizeof(cl_map_obj_t));	cl_qmap_set_obj(p_obj, p_txn);	/* assuming lookup with this key was made and the result was IB_NOT_FOUND */	cl_qmap_insert(p_tx_mgr->p_txn_map, key, &p_obj->item);	p_item = cl_qmap_head(p_tx_mgr->p_txn_map);	while (p_item != cl_qmap_end(p_tx_mgr->p_txn_map)) {		tmp_key = cl_qmap_key(p_item);		osm_log(p_tx_mgr->p_log, OSM_LOG_DEBUG,			"__osmv_txnmgr_insert_txn: "			"Found key 0x%llX /n", tmp_key);		p_item = cl_qmap_next(p_item);	}	return IB_SUCCESS;}
开发者ID:2014-class,项目名称:freerouter,代码行数:38,


示例24: clGmsClusterTrackStop

/*----------------------------------------------------------------------------- * Cluster Track Stop API *---------------------------------------------------------------------------*/ClRcT clGmsClusterTrackStop(    CL_IN const ClGmsHandleT gmsHandle){    ClRcT                           rc = CL_OK;    struct gms_instance            *gms_instance_ptr = NULL;    ClGmsClusterTrackStopRequestT   req = {0};    ClGmsClusterTrackStopResponseT *res = NULL;        CL_GMS_SET_CLIENT_VERSION( req );    rc = clHandleCheckout(gmsHandleDb, gmsHandle, (void**)&gms_instance_ptr);    if (rc != CL_OK)    {        return CL_GMS_RC(CL_ERR_INVALID_HANDLE);    }        if (gms_instance_ptr == NULL)    {        return CL_GMS_RC(CL_ERR_NULL_POINTER);    }    req.gmsHandle = gmsHandle;    req.address.iocPhyAddress.nodeAddress = clIocLocalAddressGet();    rc = clEoMyEoIocPortGet(&(req.address.iocPhyAddress.portId));        CL_ASSERT(rc == CL_OK); /* Should really never happen */        clGmsMutexLock(gms_instance_ptr->response_mutex);        rc = cl_gms_cluster_track_stop_rmd(&req, 0 /* use def. timeout */, &res);    if ((rc != CL_OK) || (res == NULL)) /* If there was an error, res isn't allocated */    {        goto error_exit;    }        rc = res->rc;        clHeapFree((void*)res);error_exit:    clGmsMutexUnlock(gms_instance_ptr->response_mutex);    if (clHandleCheckin(gmsHandleDb, gmsHandle) != CL_OK)    {        clLogError(CLM,NA,                   "/nclHandleCheckin failed");    }        return CL_GMS_RC(rc);}
开发者ID:mrv-communications-pilot,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:53,


示例25: __cl_timer_find

/* * Search for a timer with an earlier timeout than the one provided by * the context.  Both the list item and the context are pointers to * a cl_timer_t structure with valid timeouts. */static cl_status_t__cl_timer_find(IN const cl_list_item_t * const p_list_item,		IN void *const context){	cl_timer_t *p_in_list;	cl_timer_t *p_new;	CL_ASSERT(p_list_item);	CL_ASSERT(context);	p_in_list = (cl_timer_t *) p_list_item;	p_new = (cl_timer_t *) context;	CL_ASSERT(p_in_list->state == CL_INITIALIZED);	CL_ASSERT(p_new->state == CL_INITIALIZED);	CL_ASSERT(p_in_list->timer_state == CL_TIMER_QUEUED);	if (__cl_timer_is_earlier(&p_in_list->timeout, &p_new->timeout))		return (CL_SUCCESS);	return (CL_NOT_FOUND);}
开发者ID:2014-class,项目名称:freerouter,代码行数:28,



注:本文中的CL_ASSERT函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ CL_AddReliableCommand函数代码示例
C++ CLUTTER_TEXTURE函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。