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

C++ epicsMutexUnlock函数代码示例

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

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



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

示例1: epicsExitCallAtExits

epicsShareFunc void epicsExitCallAtExits(void)
{
    exitPvt * pep = 0;

    epicsExitInit ();
    epicsMutexMustLock ( exitPvtLock );
    if ( pExitPvtPerProcess ) {
        pep = pExitPvtPerProcess;
        pExitPvtPerProcess = 0;
    }
    epicsMutexUnlock ( exitPvtLock );
    if ( pep ) {
        epicsExitCallAtExitsPvt ( pep );
        destroyExitPvt ( pep );
    }
}
开发者ID:epicsdeb,项目名称:epics-base,代码行数:16,代码来源:epicsExit.c


示例2: seq_pvFlushQ

/*
 * Flush elements on syncQ queue and clear event flag.
 */
epicsShareFunc void epicsShareAPI seq_pvFlushQ(SS_ID ss, VAR_ID varId)
{
	SPROG	*sp = ss->sprog;
	CHAN	*ch = sp->chan + varId;
	EV_ID	ev_flag = ch->syncedTo;
	QUEUE	queue = ch->queue;

	DEBUG("pvFlushQ: pv name=%s, count=%d\n", ch->dbch ? ch->dbch->dbName : "<anomymous>",
		seqQueueUsed(queue));
	seqQueueFlush(queue);

	epicsMutexMustLock(sp->programLock);
	/* Clear event flag */
	bitClear(sp->evFlags, ev_flag);
	epicsMutexUnlock(sp->programLock);
}
开发者ID:A2-Collaboration,项目名称:epics,代码行数:19,代码来源:seq_if.c


示例3: interruptCallbackInput

static void interruptCallbackInput(void *drvPvt, asynUser *pasynUser, 
                epicsInt32 value)
{
    devInt32Pvt *pPvt = (devInt32Pvt *)drvPvt;
    dbCommon *pr = pPvt->pr;
    ringBufferElement *rp;

    if (pPvt->mask) {
        value &= pPvt->mask;
        if (pPvt->bipolar && (value & pPvt->signBit)) value |= ~pPvt->mask;
    }
    asynPrint(pPvt->pasynUser, ASYN_TRACEIO_DEVICE,
        "%s devAsynInt32::interruptCallbackInput new value=%d\n",
        pr->name, value);
    /* There is a problem.  A driver could be calling us with a value after
     * this record has registered for callbacks but before EPICS has set interruptAccept,
     * which means that scanIoRequest will return immediately.
     * This is very bad, because if we have pushed a value into the ring buffer
     * it won't get popped off because the record won't process.  The values
     * read the next time the record processes would then be stale.
     * We previously worked around this problem by waiting here for interruptAccept.
     * But that does not work if the callback is coming from the thread that is executing
     * iocInit, which can happen with synchronous drivers (ASYN_CANBLOCK=0) that do callbacks
     * when a value is written to them, which can happen in initRecord for an output record.
     * Instead we just return.  There will then be nothing in the ring buffer, so the first
     * read will do a read from the driver, which should be OK. */
    if (!interruptAccept) return;
    epicsMutexLock(pPvt->ringBufferLock);
    rp = &pPvt->ringBuffer[pPvt->ringHead];
    rp->value = value;
    rp->time = pasynUser->timestamp;
    rp->status = pasynUser->auxStatus;
    pPvt->ringHead = (pPvt->ringHead==pPvt->ringSize) ? 0 : pPvt->ringHead+1;
    if (pPvt->ringHead == pPvt->ringTail) {
        /* There was no room in the ring buffer.  In the past we just threw away
         * the new value.  However, it is better to remove the oldest value from the
         * ring buffer and add the new one.  That way the final value the record receives
         * is guaranteed to be the most recent value */
        pPvt->ringTail = (pPvt->ringTail==pPvt->ringSize) ? 0 : pPvt->ringTail+1;
        pPvt->ringBufferOverflows++;
    } else {
        /* We only need to request the record to process if we added a new
         * element to the ring buffer, not if we just replaced an element. */
        scanIoRequest(pPvt->ioScanPvt);
    }
    epicsMutexUnlock(pPvt->ringBufferLock);
}
开发者ID:arvinderpalaha,项目名称:asyn,代码行数:47,代码来源:devAsynInt32.c


示例4: srqPoll

static void srqPoll(asynUser *pasynUser)
{
    void *drvPvt = pasynUser->userPvt;
    int srqStatus,primary,secondary;
    GETgpibPvtasynGpibPort

    epicsMutexMustLock(pgpibPvt->lock);
    if(!pgpibPvt->pollRequestIsQueued) 
        printf("%s srqPoll but !pollRequestIsQueued. Why?\n",pgpibPvt->portName);
    pgpibPvt->pollRequestIsQueued = 0;
    epicsMutexUnlock(pgpibPvt->lock);
    srqStatus = pasynGpibPort->srqStatus(pgpibPvt->asynGpibPortPvt);
    while(srqStatus) {
        pasynGpibPort->serialPollBegin(pgpibPvt->asynGpibPortPvt);
        for(primary=0; primary<NUM_GPIB_ADDRESSES; primary++) {
            pollListPrimary *ppollListPrimary = &pgpibPvt->pollList[primary];
            pollListNode *ppollListNode = &ppollListPrimary->primary;
            int statusByte;
    
            if(ppollListNode->pollIt) {
                statusByte = pasynGpibPort->serialPoll(
                    pgpibPvt->asynGpibPortPvt,primary,SRQTIMEOUT);
                if(statusByte) {
                    pgpibPvt->srq_handler(pgpibPvt->srqHandlerPvt,
                        primary,statusByte);
                }
            }
            for(secondary=0; secondary<NUM_GPIB_ADDRESSES; secondary++) {
                ppollListNode = &ppollListPrimary->secondary[secondary];
                if(ppollListNode->pollIt) {
                    int addr = primary*100+secondary;
                    statusByte = pasynGpibPort->serialPoll(
                        pgpibPvt->asynGpibPortPvt,addr,SRQTIMEOUT);
                    if(statusByte) {
                        pgpibPvt->srq_handler(pgpibPvt->srqHandlerPvt,
                            addr,statusByte);
                    }
                }
            }
        }
        pasynGpibPort->serialPollEnd(pgpibPvt->asynGpibPortPvt);
        srqStatus = pasynGpibPort->srqStatus(pgpibPvt->asynGpibPortPvt);
        if(!srqStatus) break;
        printf("%s after srqPoll srqStatus is %x Why?\n",
            pgpibPvt->portName,srqStatus);
    }
}
开发者ID:Sangil-Lee,项目名称:RefCode,代码行数:47,代码来源:asynGpib.c


示例5: stopIsrThread

/* Caller must take devLock */
static
void
stopIsrThread(osdISR *isr)
{
    if (isr->waiter_status==osdISRDone)
        return;

    isr->waiter_status = osdISRStopping;

    while (isr->waiter_status!=osdISRDone) {
        epicsMutexUnlock(isr->osd->devLock);

        epicsEventWait(isr->done);

        epicsMutexMustLock(isr->osd->devLock);
    }
}
开发者ID:mdavidsaver,项目名称:devlib2,代码行数:18,代码来源:devLibPCIOSD.c


示例6: drvEtherIP_remove_callback

void drvEtherIP_remove_callback (PLC *plc, TagInfo *info,
                                 EIPCallback callback, void *arg)
{
    TagCallback *cb;
    epicsMutexLock(plc->lock);
    for (cb = DLL_first(TagCallback, &info->callbacks);
         cb;  cb=DLL_next(TagCallback, cb))
    {
        if (cb->callback == callback  &&  cb->arg == arg)
        {
            DLL_unlink(&info->callbacks, cb);
            free(cb);
            break;
        }
    }
    epicsMutexUnlock(plc->lock);
}
开发者ID:EPICSTools,项目名称:ether_ip,代码行数:17,代码来源:drvEtherIP.c


示例7: epicsMutexLock

/** Deletes all attributes from the list. */
int NDAttributeList::clear()
{
  NDAttribute *pAttribute;
  NDAttributeListNode *pListNode;
  //const char *functionName = "NDAttributeList::clear";

  epicsMutexLock(this->lock);
  pListNode = (NDAttributeListNode *)ellFirst(&this->list);
  while (pListNode) {
    pAttribute = pListNode->pNDAttribute;
    ellDelete(&this->list, &pListNode->node);
    delete pAttribute;
    pListNode = (NDAttributeListNode *)ellFirst(&this->list);
  }
  epicsMutexUnlock(this->lock);
  return(ND_SUCCESS);
}
开发者ID:NSLS-II-CSX,项目名称:xf23id1-ioc1,代码行数:18,代码来源:NDArray.cpp


示例8: errlogAddListener

epicsShareFunc void epicsShareAPI errlogAddListener(
    errlogListener listener, void *pPrivate)
{
    listenerNode *plistenerNode;

    errlogInit(0);
    if (pvtData.atExit)
        return;

    plistenerNode = callocMustSucceed(1,sizeof(listenerNode),
        "errlogAddListener");
    epicsMutexMustLock(pvtData.listenerLock);
    plistenerNode->listener = listener;
    plistenerNode->pPrivate = pPrivate;
    ellAdd(&pvtData.listenerList,&plistenerNode->node);
    epicsMutexUnlock(pvtData.listenerLock);
}
开发者ID:T-A-R-L-A,项目名称:EPICS-Base,代码行数:17,代码来源:errlog.c


示例9: motorAxisStop

static int motorAxisStop( AXIS_HDL pAxis, double acceleration )
{
  if (pAxis == NULL) return MOTOR_AXIS_ERROR;
  else
    {
      if (epicsMutexLock( pAxis->axisMutex ) == epicsMutexLockOK) {
	motorAxisVelocity( pAxis, 0.0, acceleration );
	pAxis->deferred_move = 0;
	epicsMutexUnlock( pAxis->axisMutex );

	pAxis->print( pAxis->logParam, TRACE_FLOW, "Set card %d, axis %d to stop with accel=%f",
		      pAxis->card, pAxis->axis, acceleration );
      }

    }
  return MOTOR_AXIS_OK;
}
开发者ID:Brudhu,项目名称:motor,代码行数:17,代码来源:drvMotorSim.c


示例10: dbCaGetAlarmLimits

long dbCaGetAlarmLimits(const struct link *plink,
    double *lolo, double *low, double *high, double *hihi)
{
    caLink *pca;
    int gotAttributes;

    pcaGetCheck
    gotAttributes = pca->gotAttributes;
    if (gotAttributes) {
        *lolo = pca->alarmLimits[0];
        *low  = pca->alarmLimits[1];
        *high = pca->alarmLimits[2];
        *hihi = pca->alarmLimits[3];
    }
    epicsMutexUnlock(pca->lock);
    return gotAttributes ? 0 : -1;
}
开发者ID:T-A-R-L-A,项目名称:EPICS-Base,代码行数:17,代码来源:dbCa.c


示例11: interruptCallbackAverage

static void interruptCallbackAverage(void *drvPvt, asynUser *pasynUser,
                epicsFloat64 value)
{
    devPvt *pPvt = (devPvt *)drvPvt;
    dbCommon *pr = pPvt->pr;

    asynPrint(pPvt->pasynUser, ASYN_TRACEIO_DEVICE,
        "%s devAsynFloat64::interruptCallbackAverage new value=%f\n",
        pr->name, value);
    epicsMutexLock(pPvt->ringBufferLock);
    pPvt->numAverage++;
    pPvt->sum += value;
    pPvt->result.status |= pasynUser->auxStatus;
    pPvt->result.alarmStatus = pasynUser->alarmStatus;
    pPvt->result.alarmSeverity = pasynUser->alarmSeverity;
    epicsMutexUnlock(pPvt->ringBufferLock);
}
开发者ID:FreddieAkeroyd,项目名称:asyn,代码行数:17,代码来源:devAsynFloat64.c


示例12: seq_efSet

/*
 * Set an event flag, then wake up each state
 * set that might be waiting on that event flag.
 */
epicsShareFunc void seq_efSet(SS_ID ss, EF_ID ev_flag)
{
	PROG	*sp = ss->prog;

	DEBUG("efSet: sp=%p, ev_flag=%d\n", sp, ev_flag);
	assert(ev_flag > 0 && ev_flag <= sp->numEvFlags);

	epicsMutexMustLock(sp->lock);

	/* Set this bit */
	bitSet(sp->evFlags, ev_flag);

	/* Wake up state sets that are waiting for this event flag */
	ss_wakeup(sp, ev_flag);

	epicsMutexUnlock(sp->lock);
}
开发者ID:ukaea,项目名称:epics,代码行数:21,代码来源:seq_if.c


示例13: findProvider

static gtProvider * findProvider(ELLLIST *plist, epicsMutexId lock,
    const char *name, int priority)
{
    gtProvider *ptp;

    epicsMutexMustLock(lock);

    for (ptp = (gtProvider *)ellFirst(plist);
         ptp; ptp = (gtProvider *)ellNext(&ptp->node)) {
        if (ptp->priority == ptp->priority &&
            !strcmp(ptp->name, name))
            break;
    }

    epicsMutexUnlock(lock);
    return ptp;
}
开发者ID:zlxmsu,项目名称:TestEpics,代码行数:17,代码来源:epicsGeneralTime.c


示例14: seq_efClear

/*
 * Clear event flag.
 */
epicsShareFunc boolean seq_efClear(SS_ID ss, EF_ID ev_flag)
{
	PROG	*sp = ss->prog;
	boolean	isSet;

	assert(ev_flag > 0 && ev_flag <= ss->prog->numEvFlags);
	epicsMutexMustLock(sp->lock);

	isSet = bitTest(sp->evFlags, ev_flag);
	bitClear(sp->evFlags, ev_flag);

	/* Wake up state sets that are waiting for this event flag */
	ss_wakeup(sp, ev_flag);

	epicsMutexUnlock(sp->lock);

	return isSet;
}
开发者ID:ukaea,项目名称:epics,代码行数:21,代码来源:seq_if.c


示例15: epicsMessageQueuePending

epicsShareFunc int epicsShareAPI
epicsMessageQueuePending(epicsMessageQueueId pmsg)
{
    char *myInPtr, *myOutPtr;
    int nmsg;

    epicsMutexLock(pmsg->mutex);
    myInPtr = (char *)pmsg->inPtr;
    myOutPtr = (char *)pmsg->outPtr;
    if (pmsg->full)
        nmsg = pmsg->capacity;
    else if (myInPtr >= myOutPtr)
        nmsg = (myInPtr - myOutPtr) / pmsg->slotSize;
    else
        nmsg = pmsg->capacity  - (myOutPtr - myInPtr) / pmsg->slotSize;
    epicsMutexUnlock(pmsg->mutex);
    return nmsg;
}
开发者ID:ISISComputingGroup,项目名称:EPICS-base,代码行数:18,代码来源:osdMessageQueue.cpp


示例16: writeOctet

static asynStatus writeOctet(void *ppvt,asynUser *pasynUser,const char *data,size_t numchars,size_t *nbytes)
{
    int addr;
    asynStatus status;
    Port* pport=(Port*)ppvt;
    Command* pcommand=(Command*)pasynUser->drvUser;

    if( pport->init==0 ) return( asynError );
    if( pasynManager->getAddr(pasynUser,&addr)) return( asynError );

    epicsMutexMustLock(pport->syncLock);
    status = pcommand->writeFunc(pcommand,pport->pasynUser,(char*)data,ifaceAsynOctet);
    epicsMutexUnlock(pport->syncLock);

    if( ASYN_ERROR(status) ) *nbytes=0; else *nbytes=strlen(data);

    return( status );
}
开发者ID:A2-Collaboration,项目名称:epics,代码行数:18,代码来源:drvAsynCoherentSDG.cpp


示例17: epicsThreadPoolReleaseShared

epicsShareFunc void epicsThreadPoolReleaseShared(epicsThreadPool *pool)
{
    if (!pool)
        return;

    epicsMutexMustLock(sharedPoolsGuard);

    assert(pool->sharedCount > 0);

    pool->sharedCount--;

    if (pool->sharedCount == 0) {
        ellDelete(&sharedPools, &pool->sharedNode);
        epicsThreadPoolDestroy(pool);
    }

    epicsMutexUnlock(sharedPoolsGuard);
}
开发者ID:epicsdeb,项目名称:epics-base,代码行数:18,代码来源:threadPool.c


示例18: devSiTPG262Read_gst_str

LOCAL long devSiTPG262Read_gst_str(drvTPG262Config* pdrvTPG262Config, int gauge_num, char* gst_str)
{
    TPG262_read* pTPG262_read = (TPG262_read*)pdrvTPG262Config->pTPG262_read;

    epicsMutexLock(pdrvTPG262Config->lock);
    switch(gauge_num){
        case 0:
            strcpy(gst_str, pTPG262_read->gst_str0);
            break;
        case 1:
            strcpy(gst_str, pTPG262_read->gst_str1);
            break;
        default:
            gst_str[0] = NULL;
    }
    epicsMutexUnlock(pdrvTPG262Config->lock);
    return 0;
}
开发者ID:Sangil-Lee,项目名称:RefCode,代码行数:18,代码来源:devTPG262.c


示例19: drvMK80S_timeoutCallback

static void drvMK80S_timeoutCallback(asynUser* pasynMK80SUser)
{
	kuDebug (kuTRACE, "[drvMK80S_timeoutCallback] timeout \n");

    asynMK80SUserData* pasynMK80SUserData = (asynMK80SUserData*) pasynMK80SUser->userPvt;
    drvMK80SConfig* pdrvMK80SConfig = (drvMK80SConfig*) pasynMK80SUserData->pdrvMK80SConfig;

    pdrvMK80SConfig->status |= MK80SSTATUS_TIMEOUT_MASK;

    epicsMutexLock(pdrvMK80SConfig->lock);
    pdrvMK80SConfig->cbCount =0;
    pdrvMK80SConfig->timeoutCount++;
    epicsMutexUnlock(pdrvMK80SConfig->lock);

    scanIoRequest(pdrvMK80SConfig->ioScanPvt);

   return; 
}
开发者ID:Sangil-Lee,项目名称:RefCode,代码行数:18,代码来源:drvMK80S.c


示例20: interruptCallbackOutput

static void interruptCallbackOutput(void *drvPvt, asynUser *pasynUser,
                epicsInt32 value)
{
    devInt32Pvt *pPvt = (devInt32Pvt *)drvPvt;
    dbCommon *pr = pPvt->pr;
    int count, size = sizeof(epicsInt32);

    asynPrint(pPvt->pasynUser, ASYN_TRACEIO_DEVICE,
        "%s devAsynInt32::interruptCallbackOutput new value=%d\n",
        pr->name, value);
    epicsMutexLock(pPvt->mutexId);
    count = epicsRingBytesPut(pPvt->ringBuffer, (char *)&value, size);
    if (count != size) {
        pPvt->ringBufferOverflows++;
    }
    epicsMutexUnlock(pPvt->mutexId);
    scanOnce(pr);
}
开发者ID:A2-Collaboration,项目名称:epics,代码行数:18,代码来源:devAsynInt32.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ epicsSnprintf函数代码示例发布时间:2022-05-30
下一篇:
C++ epicsMutexMustLock函数代码示例发布时间: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