• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ clOsalMutexLock函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: cpmClusterTrackCallBack

void cpmClusterTrackCallBack(ClGmsHandleT handle, const ClGmsClusterNotificationBufferT *clusterNotificationBuffer, ClUint32T nMembers, ClRcT rc)
{
    clLogMultiline(CL_LOG_SEV_DEBUG, CPM_LOG_AREA_CPM, CPM_LOG_CTX_CPM_GMS,
                   "Received cluster track callback from GMS on node [%s] -- \n"
                   "Leader : [%d] \n"
                   "Deputy : [%d] (-1 -> No deputy) \n"
                   "Leader changed ? [%s] \n"
                   "Number of nodes in callback : [%d]",
                   gpClCpm->pCpmLocalInfo->nodeName,
                   clusterNotificationBuffer->leader,
                   clusterNotificationBuffer->deputy,
                   clusterNotificationBuffer->leadershipChanged ? "Yes" : "No",
                   clusterNotificationBuffer->numberOfItems);

    clOsalMutexLock(&gpClCpm->cpmGmsMutex);
    gpClCpm->trackCallbackInProgress = CL_TRUE;
    clOsalMutexUnlock(&gpClCpm->cpmGmsMutex);
    cpmHandleGroupInformation(clusterNotificationBuffer);

    rc = clOsalMutexLock(&gpClCpm->cpmGmsMutex);
    gpClCpm->trackCallbackInProgress = CL_FALSE;
    CL_CPM_CHECK_1(CL_LOG_SEV_ERROR, CL_CPM_LOG_1_OSAL_MUTEX_LOCK_ERR, rc, rc,
                   CL_LOG_HANDLE_APP);
    rc = clOsalCondSignal(&gpClCpm->cpmGmsCondVar);
    CL_CPM_CHECK_1(CL_LOG_SEV_ERROR, CL_CPM_LOG_1_OSAL_COND_SIGNAL_ERR, rc, rc,
                   CL_LOG_HANDLE_APP);
    rc = clOsalMutexUnlock(&gpClCpm->cpmGmsMutex);
    CL_CPM_CHECK_1(CL_LOG_SEV_ERROR, CL_CPM_LOG_1_OSAL_MUTEX_UNLOCK_ERR, rc, rc,
                   CL_LOG_HANDLE_APP);
failure:
    return;
}
开发者ID:mrv-communications-pilot,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:32,代码来源:clCpmGms.c


示例2: clAlarmPayloadCntDelete

/*
 * This api would be called as and when the object is no more and the corresponding entry 
 * within the container needs to be deleted.
 */
ClRcT clAlarmPayloadCntDelete(ClCorMOIdPtrT pMoId, ClAlarmProbableCauseT probCause, ClAlarmSpecificProblemT specificProblem)
{
	ClRcT rc = CL_OK;
	ClCntNodeHandleT nodeH;
    ClAlarmPayloadCntKeyT *pCntKey = clHeapAllocate(sizeof(ClAlarmPayloadCntKeyT));
    if(NULL == pCntKey)
    {
          CL_DEBUG_PRINT (CL_DEBUG_CRITICAL,("Memory allocation failed with rc 0x%x ", rc));
          return (rc);
    }    
    pCntKey->probCause = probCause;
    pCntKey->specificProblem = specificProblem;
    pCntKey->moId = *pMoId;

    clOsalMutexLock(gClAlarmPayloadCntMutex);        
    rc = clCntNodeFind(gPayloadCntHandle,(ClCntKeyHandleT)pCntKey,&nodeH);
	if(CL_OK == rc)
	{
    	rc = clCntAllNodesForKeyDelete(gPayloadCntHandle,(ClCntKeyHandleT)pCntKey);
    	if (CL_OK != rc)
	    {
        	CL_DEBUG_PRINT(CL_DEBUG_ERROR, ("clCntAllNodesForKeyDelete failed w rc:0x%x\n", rc));
	    }        
	}
	else
	{
		CL_DEBUG_PRINT(CL_DEBUG_ERROR, ("Node does not exist with rc:0x%x\n", rc));
	}
    clHeapFree(pCntKey);
	clOsalMutexUnlock(gClAlarmPayloadCntMutex);    
	return rc;
}
开发者ID:NguyenHoangOC,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:36,代码来源:clAlarmPayloadCont.c


示例3: tsAllActiveTimersPrint

void
tsAllActiveTimersPrint (void)
{
    ClRcT returnCode = CL_ERR_INVALID_HANDLE;
    ClUint32T count = 0;
    TsTimer_t* pUserTimer = NULL;

    returnCode = clOsalMutexLock (gActiveTimerQueue.timerMutex);

    if (returnCode != CL_OK) {
        return;
    }

    if (gActiveTimerQueue.pFirstTimer == NULL) {
        /* no elements to display */
        returnCode = clOsalMutexUnlock (gActiveTimerQueue.timerMutex);
        return;
    }

    for (pUserTimer = gActiveTimerQueue.pFirstTimer, count = 0;
            pUserTimer != NULL;
            pUserTimer = pUserTimer->pNextActiveTimer, count++) {
        clOsalPrintf ("(%d) Timer timeout = %us, timestamp->sec = %ld, timestamp->Microsec = %ld.\n",
                      (ClInt32T)count,
                      pUserTimer->timeOut.tsSec,
                      pUserTimer->timestamp/1000000ULL,
                      pUserTimer->timestamp%1000000ULL);
    }

    returnCode = clOsalMutexUnlock (gActiveTimerQueue.timerMutex);
}
开发者ID:NguyenHoangOC,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:31,代码来源:clTimerOld.c


示例4: clEoClientCallbackDbFinalize

ClRcT clEoClientCallbackDbFinalize(void)
{
    ClRcT rc;
    ClUint32T i;
    
    rc = clOsalMutexLock(&gpCallbackDb.lock);
    if(rc != CL_OK)
    {
        /* Print a message here */
        return rc;
    }

    for(i = 0 ; i < gpCallbackDb.numRecs; i++)
    {
        if(gpCallbackDb.pDb[i] != NULL)
            clHeapFree(gpCallbackDb.pDb[i]);
    }

    clHeapFree(gpCallbackDb.pDb);

    gpCallbackDb.numRecs = 0;

    clOsalMutexUnlock(&gpCallbackDb.lock);

    return CL_OK;
}
开发者ID:rajiva,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:26,代码来源:clEoLibs.c


示例5: clBitmap2BufferGet

ClRcT
clBitmap2BufferGet(ClBitmapHandleT  hBitmap,
                   ClUint32T        *pListLen,
                   ClUint8T         **ppPositionList)
{
    ClBitmapInfoT  *pBitmapInfo = hBitmap;
    ClRcT          rc           = CL_OK;

    if( CL_BM_INVALID_BITMAP_HANDLE == hBitmap )
    {
        CL_DEBUG_PRINT(CL_DEBUG_ERROR, ("Invalid Handle"));
        return CL_BITMAP_RC(CL_ERR_INVALID_HANDLE);
    }

    rc = clOsalMutexLock(pBitmapInfo->bitmapLock);
    if( CL_OK != rc )
    {
        CL_DEBUG_PRINT(CL_DEBUG_ERROR, ("clOsalMutexLock() rc: %x", rc)); 
        return rc;
    }
    *ppPositionList = clHeapCalloc(pBitmapInfo->nBytes, sizeof(ClUint8T));
    if( NULL == *ppPositionList )
    {
        CL_DEBUG_PRINT(CL_DEBUG_ERROR, ("clHeapCalloc()"));
        clOsalMutexUnlock(pBitmapInfo->bitmapLock);
        return rc;
    }
    memcpy(*ppPositionList, pBitmapInfo->pBitmap, pBitmapInfo->nBytes);
    *pListLen = pBitmapInfo->nBytes;

    clOsalMutexUnlock(pBitmapInfo->bitmapLock);
    CL_DEBUG_PRINT(CL_DEBUG_TRACE, ("Exit"));
    return rc;
}
开发者ID:NguyenHoangOC,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:34,代码来源:clBitmap.c


示例6: clMemPartRealloc

ClPtrT clMemPartRealloc(ClMemPartHandleT handle, ClPtrT memBase, ClUint32T size)
{
    MEM_PART_STATS memPartStats;
    ClPtrT mem = NULL;
    ClMemPartT *pMemPart = NULL;
    ClRcT rc = CL_OK;

    if(!(pMemPart = (ClMemPartT*)handle) )
        return NULL;

    if(!size) size = 16;

    clOsalMutexLock(&pMemPart->mutex);
    if(memPartInfoGet(pMemPart->partId, &memPartStats) == ERROR)
    {
        clOsalMutexUnlock(&pMemPart->mutex);
        CL_DEBUG_PRINT(CL_DEBUG_ERROR, ("memPartInfoGet for size [%d] failed with [%s]\n", size, strerror(errno)));
        return mem;
    }
    if(size >= memPartStats.numBytesFree)
    {
        if( (rc = clMemPartExpand(pMemPart, CL_MEM_PART_EXPANSION_SIZE) ) != CL_OK)
        {
            /* do nothing now and fall back to realloc.*/
        }
    }
    mem = memPartRealloc(pMemPart->partId, memBase, size);
    clOsalMutexUnlock(&pMemPart->mutex);
    if(!mem)
    {
        CL_DEBUG_PRINT(CL_DEBUG_ERROR, ("Mem part realloc failure for size [%d]\n", size));
        CL_ASSERT(0);
    }
    return mem;
}
开发者ID:NguyenHoangOC,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:35,代码来源:clMemPart.c


示例7: cpmNodeFind

/*
 * Called with the cpmTableMutex lock held.
 */
ClRcT cpmNodeFind(SaUint8T *name, ClCpmLT **cpmL)
{
    ClRcT rc = CL_OK;
    clOsalMutexLock(gpClCpm->cpmTableMutex);
    rc = cpmNodeFindLocked(name, cpmL);
    clOsalMutexUnlock(gpClCpm->cpmTableMutex);
    return rc;
}
开发者ID:joaohf,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:11,代码来源:clCpmCommon.c


示例8: clTimerStop

ClRcT
clTimerStop (ClTimerHandleT  timerHandle)
{
    /* make sure the timer actually exists */
    ClRcT returnCode = CL_ERR_INVALID_HANDLE;
    TsTimer_t* pUserTimer = NULL;

    CL_FUNC_ENTER();
    pUserTimer = (TsTimer_t*) timerHandle;

    if (pUserTimer == NULL) {
        /* debug message */
        returnCode = CL_TIMER_RC(CL_ERR_INVALID_HANDLE);
        clDbgCodeError(returnCode, ("Bad timer handle"));
        CL_FUNC_EXIT();
        return (returnCode);
    }

    if (pUserTimer->state == TIMER_FREE) {
        returnCode = CL_TIMER_RC(CL_TIMER_ERR_INVALID_TIMER);
        clDbgCodeError(returnCode, ("Attempt to stop a deleted timer."));
        CL_FUNC_EXIT();
        return (returnCode);
    }

    /* if the timer is active, remove it from the active-timers queue */
    if (pUserTimer->state == TIMER_ACTIVE) {
        returnCode = clOsalMutexLock (gActiveTimerQueue.timerMutex);
        if (returnCode != CL_OK) {
            CL_FUNC_EXIT();
            return (returnCode);
        }

        returnCode = tsActiveTimerDequeue (pUserTimer);
        if (returnCode != CL_OK) {
            if(CL_OK != clOsalMutexUnlock (gActiveTimerQueue.timerMutex)) {
                CL_FUNC_EXIT();
                return(returnCode);
            }
            CL_FUNC_EXIT();
            return (returnCode);
        }

        returnCode = clOsalMutexUnlock (gActiveTimerQueue.timerMutex);
        if (returnCode != CL_OK) {
            CL_FUNC_EXIT();
            return (returnCode);
        }
    }

    /* mark the timer as inactive */
    pUserTimer->state = TIMER_INACTIVE;

    CL_FUNC_EXIT();
    return (CL_OK);
}
开发者ID:NguyenHoangOC,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:56,代码来源:clTimerOld.c


示例9: safTerminate

static void safTerminate(SaInvocationT invocation, const SaNameT *compName)
{
    SaAisErrorT rc = SA_AIS_OK;
    if(gClMsgInit)
    {
        ClBoolT lockStatus = CL_TRUE;
        ClTimerTimeOutT timeout = {.tsSec = 0, .tsMilliSec = 0};
        clOsalMutexLock(&gClMsgFinalizeLock);
        while(gClMsgSvcRefCnt > 0)
        {
            clOsalCondWait(&gClMsgFinalizeCond, &gClMsgFinalizeLock, timeout);
        }
        safMsgFinalize(&lockStatus);
        if(lockStatus)
        {
            clOsalMutexUnlock(&gClMsgFinalizeLock);
        }
    }
    rc = saAmfComponentUnregister(amfHandle, compName, NULL);
    clCpmClientFinalize(amfHandle);
    //clCpmResponse(cpmHandle, invocation, CL_OK);
    saAmfResponse(amfHandle, invocation, SA_AIS_OK);
    
    return;
}


static void clMsgRegisterWithCpm(void)
{
    SaAisErrorT rc = SA_AIS_OK;
    SaAmfCallbacksT    callbacks = {0};
    SaVersionT  version = {0};

    version.releaseCode = 'B';
    version.majorVersion = 0x01;
    version.minorVersion = 0x01;
                                                                                                                             
    callbacks.saAmfHealthcheckCallback = NULL;
    callbacks.saAmfComponentTerminateCallback = safTerminate;
    callbacks.saAmfCSISetCallback = NULL;
    callbacks.saAmfCSIRemoveCallback = NULL;
    callbacks.saAmfProtectionGroupTrackCallback = NULL;
    

    rc = saAmfInitialize(&amfHandle, &callbacks, &version);
    if( rc != SA_AIS_OK)
    {
         clLogError("MSG", "INI", "saAmfInitialize failed with  error code [0x%x].", rc);
         return ;
    }


    rc = saAmfComponentNameGet(amfHandle, &appName);

    rc = saAmfComponentRegister(amfHandle, &appName, NULL);
}
开发者ID:rajiva,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:56,代码来源:clMsgEo.c


示例10: clLogError

static ClAmsEntityTriggerT *clAmsEntityTriggerCreate(ClAmsEntityT *pEntity,
                                                     ClMetricT *pMetric)
{
    ClAmsEntityTriggerT *pEntityTrigger = NULL;

    if(!pEntity || !pMetric)
        goto out;
    
    if(pMetric->id >= CL_METRIC_MAX)
    {
        clLogError("TRIGGER", "CREATE",
                   "Invalid metric [%#x] for entity [%.*s]",
                   pMetric->id, pEntity->name.length-1, pEntity->name.value);
        goto out;
    }    

    clOsalMutexLock(&gClAmsEntityTriggerList.list.mutex);
    pEntityTrigger = clAmsEntityTriggerFind(pEntity);
    if(!pEntityTrigger)
    {
        clOsalMutexUnlock(&gClAmsEntityTriggerList.list.mutex);
        pEntityTrigger = (ClAmsEntityTriggerT*) clHeapCalloc(1, sizeof(*pEntityTrigger));
        if(!pEntityTrigger)
        {
            clLogError("TRIGGER", "CREATE", "Memory allocation failure");
            goto out;
        }
        memcpy(&pEntityTrigger->entity, pEntity, sizeof(pEntityTrigger->entity));
        clAmsEntityTriggerLoadDefaults(pEntityTrigger, CL_METRIC_ALL);
        clLogNotice("TRIGGER", "CREATE", "Entity [%.*s], Metric [%#x]",
                    pEntity->name.length-1, pEntity->name.value, pMetric->id);
        clOsalMutexLock(&gClAmsEntityTriggerList.list.mutex);
        clAmsEntityTriggerListAdd(pEntityTrigger);
    }

    clAmsEntityTriggerUpdate(pEntityTrigger, pMetric);
    clAmsEntityTriggerCheck(pEntityTrigger, pMetric);

    clOsalMutexUnlock(&gClAmsEntityTriggerList.list.mutex);

    out:
    return pEntityTrigger;
}
开发者ID:joaohf,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:43,代码来源:clAmsEntityTrigger.c


示例11: clAmsEntityTriggerRecoveryListAdd

static __inline__ ClRcT clAmsEntityTriggerRecoveryListAdd(ClAmsEntityTriggerT *pEntityTrigger)
{
    clOsalMutexLock(&gClAmsEntityTriggerRecoveryCtrl.list.mutex);
    clListAddTail(&pEntityTrigger->list, 
                  &gClAmsEntityTriggerRecoveryCtrl.list.list);
    ++gClAmsEntityTriggerRecoveryCtrl.list.numElements;
    clOsalCondSignal(&gClAmsEntityTriggerRecoveryCtrl.list.cond);
    clOsalMutexUnlock(&gClAmsEntityTriggerRecoveryCtrl.list.mutex);
    return CL_OK;
}
开发者ID:joaohf,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:10,代码来源:clAmsEntityTrigger.c


示例12: cpmInvocationGet

ClRcT cpmInvocationGet(ClInvocationT invocationId,
                       ClUint32T *cbType,
                       void **data)
{
    ClRcT rc = CL_OK;
    clOsalMutexLock(gpClCpm->invocationMutex);
    rc = cpmInvocationGetWithLock(invocationId, cbType, data);
    clOsalMutexUnlock(gpClCpm->invocationMutex);
    return rc;
}
开发者ID:joaohf,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:10,代码来源:clCpmCommon.c


示例13: clPyGlueTerminate

void clPyGlueTerminate()
{
    clRunPython("eoApp.Stop()");
    clOsalCondBroadcast (&event);
    clOsalMutexLock(&pyMutex);
    quit=1;
    PyEval_AcquireThread(thrdState);
    Py_Finalize();
    clOsalMutexUnlock(&pyMutex);
}
开发者ID:joaohf,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:10,代码来源:pyglue.c


示例14: clEoNotificationCallbackInstall

ClRcT clEoNotificationCallbackInstall(ClIocPhysicalAddressT compAddr, ClPtrT pFunc, ClPtrT pArg, ClHandleT *pHandle)
{
    ClRcT rc = CL_OK;
    ClUint32T i = 0;
    ClEoCallbackRecT **tempDb;
    
    if(pFunc == NULL || pHandle == NULL)
    {
        return CL_EO_RC(CL_ERR_INVALID_PARAMETER);
    }

    rc = clOsalMutexLock(&gpCallbackDb.lock);
    if(rc != CL_OK)
    {
        /* Print an error message here */
        return rc;
    }

re_check:
    for(; i < gpCallbackDb.numRecs; i++)
    {
        if(gpCallbackDb.pDb[i] == NULL)
        {
            ClEoCallbackRecT *pRec = {0};

            pRec =(ClEoCallbackRecT *)clHeapAllocate(sizeof(ClEoCallbackRecT));

            pRec->node = compAddr.nodeAddress;
            pRec->port = compAddr.portId;
            pRec->pFunc = *((ClCpmNotificationFuncT*)&pFunc);
            pRec->pArg = pArg;

            *pHandle = i;

            gpCallbackDb.pDb[i] = pRec;
            goto out;
        }
    }
    
    tempDb = clHeapRealloc(gpCallbackDb.pDb, sizeof(ClEoCallbackRecT *) * gpCallbackDb.numRecs * 2);
    if(tempDb == NULL)
    {
        rc  = CL_EO_RC(CL_ERR_NO_MEMORY);
        goto out;
    }
    memset(tempDb + gpCallbackDb.numRecs, 0, sizeof(ClEoCallbackRecT *) * gpCallbackDb.numRecs);
    gpCallbackDb.pDb =  tempDb;
    gpCallbackDb.numRecs *= 2;
    goto re_check;

out :
    clOsalMutexUnlock(&gpCallbackDb.lock);
    return rc;
}
开发者ID:rajiva,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:54,代码来源:clEoLibs.c


示例15: clCpmComponentListAll

ClRcT clCpmComponentListAll(ClUint32T argc, ClCharT *argv[], ClCharT **retStr)
{
    ClRcT rc = CL_OK;

    clOsalMutexLock(gpClCpm->compTableMutex);

    rc = _clCpmComponentListAll(argc, retStr);

    clOsalMutexUnlock(gpClCpm->compTableMutex);

    return rc;
}
开发者ID:NguyenHoangOC,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:12,代码来源:clCpmCliCommands.c


示例16: clAlarmPayloadCntAdd

/*
 * The cnt add function
 * The information is read from COR and then populated in the container
 * This api would be called as and when the object is created and the corresponding entry 
 * within the container needs to be added.
 */
ClRcT clAlarmPayloadCntAdd(ClAlarmInfoT *pAlarmInfo)
{
	ClRcT rc = CL_OK;
	ClCntNodeHandleT nodeH;
    ClAlarmPayloadCntT *payloadInfo;
    
    ClAlarmPayloadCntKeyT *pCntKey = clHeapAllocate(sizeof(ClAlarmPayloadCntKeyT));
    if(NULL == pCntKey)
    {
          CL_DEBUG_PRINT (CL_DEBUG_CRITICAL,("Memory allocation failed with rc 0x%x ", rc));
          return CL_ALARM_RC(CL_ALARM_ERR_NO_MEMORY);
    }    

    payloadInfo = NULL;
    pCntKey->probCause = pAlarmInfo->probCause;
    pCntKey->specificProblem = pAlarmInfo->specificProblem;
    pCntKey->moId = pAlarmInfo->moId;

    payloadInfo = clHeapAllocate(sizeof(ClAlarmPayloadCntT)+pAlarmInfo->len);
    if(NULL == payloadInfo)
    {
          CL_DEBUG_PRINT (CL_DEBUG_CRITICAL,("Memory allocation failed with rc 0x%x ", rc));
          clHeapFree(pCntKey);
          return CL_ALARM_RC(CL_ALARM_ERR_NO_MEMORY);
    }    
    payloadInfo->len = pAlarmInfo->len;
    memcpy(payloadInfo->buff, pAlarmInfo->buff, payloadInfo->len);

	clOsalMutexLock(gClAlarmPayloadCntMutex);        
    rc = clCntNodeFind(gPayloadCntHandle,(ClCntKeyHandleT)pCntKey,&nodeH);
	if(rc != CL_OK)
	{
		rc = clCntNodeAdd((ClCntHandleT)gPayloadCntHandle,
							(ClCntKeyHandleT)pCntKey,
							(ClCntDataHandleT)payloadInfo,
							NULL);
		if (CL_OK != rc)
		{
			CL_DEBUG_PRINT(CL_DEBUG_ERROR,("clCntNodeAdd failed with rc = %x\n", rc));
            clHeapFree(payloadInfo);
            clHeapFree(pCntKey);
        }
        CL_DEBUG_PRINT(CL_DEBUG_TRACE,("clCntNodeAdd adding payloadInfo->len : %d\n",payloadInfo->len));
	}
	else
	{
		CL_DEBUG_PRINT(CL_DEBUG_INFO,("Node already exist\n"));
        clHeapFree(payloadInfo);
        clHeapFree(pCntKey);
	}
	clOsalMutexUnlock(gClAlarmPayloadCntMutex);
	return rc;
}
开发者ID:NguyenHoangOC,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:59,代码来源:clAlarmPayloadCont.c


示例17: clBitmapWalk

ClRcT 
clBitmapWalk(ClBitmapHandleT  hBitmap, 
             ClBitmapWalkCbT  fpUserSetBitWalkCb, 
             void             *pCookie)
{    
    ClRcT          rc           = CL_OK;
    ClBitmapInfoT  *pBitmapInfo = hBitmap;
    ClUint32T      elementIdx   = 0;
    ClUint32T      bitIdx       = 0;
    ClUint32T      bitNum       = 0;
    
    CL_DEBUG_PRINT(CL_DEBUG_TRACE, ("Enter"));

    if( CL_BM_INVALID_BITMAP_HANDLE == hBitmap )
    {
        CL_DEBUG_PRINT(CL_DEBUG_ERROR, ("Invalid Handle"));
        return CL_BITMAP_RC(CL_ERR_INVALID_HANDLE);
    }

    if( NULL == fpUserSetBitWalkCb ) 
    {
        CL_DEBUG_PRINT(CL_DEBUG_ERROR, ("NULL parameter")); 
        return CL_BITMAP_RC(CL_ERR_NULL_POINTER);
    }

    rc = clOsalMutexLock(pBitmapInfo->bitmapLock);
    if( CL_OK != rc )
    {
        CL_DEBUG_PRINT(CL_DEBUG_ERROR, ("clOsalMutexLock() rc: %x", rc)); 
        return rc;
    }

    for (bitNum = 0; bitNum < pBitmapInfo->nBits; ++bitNum)
    { 
        elementIdx = bitNum / CL_BM_BITS_IN_BYTE;
        bitIdx = bitNum % CL_BM_BITS_IN_BYTE;
        if( (pBitmapInfo->pBitmap)[elementIdx] & (0x1 << bitIdx) )
        {
            rc = fpUserSetBitWalkCb(hBitmap, bitNum, pCookie);
            if( CL_OK != rc )
            {
                CL_DEBUG_PRINT(CL_DEBUG_ERROR, 
                               ("fpBitmapWalkCb() rc: %x", rc));
                break;
            }
        }
    }
        
    clOsalMutexUnlock(pBitmapInfo->bitmapLock);
    CL_DEBUG_PRINT(CL_DEBUG_TRACE, ("Exit"));
    return rc;
}
开发者ID:NguyenHoangOC,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:52,代码来源:clBitmap.c


示例18: 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,代码来源:clDispatchApi.c


示例19: tsActiveTimersQueueDestroy

static ClRcT
tsActiveTimersQueueDestroy (void)
{
    ClRcT returnCode = CL_ERR_INVALID_HANDLE;
    TsTimer_t* pUserTimer = NULL;
    TsTimer_t* pNextUserTimer = NULL;

    CL_FUNC_ENTER();
    returnCode = clOsalMutexLock (gActiveTimerQueue.timerMutex);

    if (returnCode != CL_OK) {
        CL_FUNC_EXIT();
        return (returnCode);
    }

    pNextUserTimer = NULL;

    for (pUserTimer = gActiveTimerQueue.pFirstTimer;
            pUserTimer != NULL;
            pUserTimer = pNextUserTimer) {

        pNextUserTimer = pUserTimer->pNextActiveTimer;

        returnCode = clOsalMutexUnlock (gActiveTimerQueue.timerMutex);

        returnCode = clTimerDelete ((ClTimerHandleT*)&pUserTimer);

        returnCode = clOsalMutexLock (gActiveTimerQueue.timerMutex);
    }

    gActiveTimerQueue.timerServiceInitialized = 0;

    returnCode = clOsalMutexUnlock (gActiveTimerQueue.timerMutex);

    returnCode = clOsalMutexDelete (gActiveTimerQueue.timerMutex);

    CL_FUNC_EXIT();
    return (returnCode);
}
开发者ID:NguyenHoangOC,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:39,代码来源:clTimerOld.c


示例20: 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,代码来源:pyglue.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ clOsalMutexUnlock函数代码示例发布时间:2022-05-30
下一篇:
C++ clHeapFree函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap