当前位置: 首页>>代码示例>>C++>>正文


C++ epicsEventSignal函数代码示例

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


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

示例1: callDone

static void callDone(dbCommon *precord, processNotify *ppn)
{
    notifyPvt *pnotifyPvt = (notifyPvt *) ppn->pnotifyPvt;

    epicsMutexUnlock(pnotifyGlobal->lock);
    if (ppn->requestType == processGetRequest ||
        ppn->requestType == putProcessGetRequest) {
        ppn->getCallback(ppn, getFieldType);
    }
    dbScanUnlock(precord);
    ppn->doneCallback(ppn);
    epicsMutexMustLock(pnotifyGlobal->lock);
    if (pnotifyPvt->cancelWait && pnotifyPvt->userCallbackWait) {
        errlogPrintf("%s processNotify: both cancelWait and userCallbackWait true."
               "This is illegal\n", precord->name);
        pnotifyPvt->cancelWait = pnotifyPvt->userCallbackWait = 0;
    }
    if (!pnotifyPvt->cancelWait && !pnotifyPvt->userCallbackWait) {
        notifyCleanup(ppn);
        epicsMutexUnlock(pnotifyGlobal->lock); 
        return;
    }
    if (pnotifyPvt->cancelWait) {
        pnotifyPvt->cancelWait = 0;
        epicsEventSignal(pnotifyPvt->cancelEvent);
        epicsMutexUnlock(pnotifyGlobal->lock);
        return;
    }
    assert(pnotifyPvt->userCallbackWait);
    pnotifyPvt->userCallbackWait = 0;
    epicsEventSignal(pnotifyPvt->userCallbackEvent);
    epicsMutexUnlock(pnotifyGlobal->lock);
    return;
}
开发者ID:epicsdeb,项目名称:epics-base,代码行数:34,代码来源:dbNotify.c

示例2: tester

static void tester(void *raw)
{
    caster_t *self = raw;
    epicsEventId sd;

    testDiag("UDP tester starts");

    epicsMutexMustLock(lock);

    while(!self->shutdown) {

        epicsMutexUnlock(lock);
        epicsEventMustWait(cycled[1]);
        epicsMutexMustLock(lock);

        result = doCasterUDPPhase(self);
        cycles++;

        epicsEventSignal(cycled[0]);
    }

    testDiag("UDP tester stops");
    sd = self->shutdownEvent;
    epicsMutexUnlock(lock);

    epicsEventSignal(sd);
}
开发者ID:ChannelFinder,项目名称:recsync,代码行数:27,代码来源:testudp.c

示例3: callUser

static void callUser(dbCommon *precord,putNotify *ppn)
{
    putNotifyPvt *pputNotifyPvt = (putNotifyPvt *)ppn->pputNotifyPvt;

    epicsMutexUnlock(pnotifyGlobal->lock);
    dbScanUnlock(precord);
    (*ppn->userCallback)(ppn);
    epicsMutexMustLock(pnotifyGlobal->lock);
    if(pputNotifyPvt->cancelWait && pputNotifyPvt->userCallbackWait) {
        errlogPrintf("%s putNotify: both cancelWait and userCallbackWait true."
               "This is illegal\n",precord->name);
        pputNotifyPvt->cancelWait = pputNotifyPvt->userCallbackWait = 0;
    }
    if(!pputNotifyPvt->cancelWait && !pputNotifyPvt->userCallbackWait) {
        putNotifyCleanup(ppn);
        epicsMutexUnlock(pnotifyGlobal->lock); 
        return;
    }
    if(pputNotifyPvt->cancelWait) {
        pputNotifyPvt->cancelWait = 0;
        epicsEventSignal(pputNotifyPvt->cancelEvent);
        epicsMutexUnlock(pnotifyGlobal->lock);
        return;
    }
    assert(pputNotifyPvt->userCallbackWait);
    pputNotifyPvt->userCallbackWait = 0;
    epicsEventSignal(pputNotifyPvt->userCallbackEvent);
    epicsMutexUnlock(pnotifyGlobal->lock);
    return;
}
开发者ID:ukaea,项目名称:epics,代码行数:30,代码来源:dbNotify.c

示例4: callbackTask

static void callbackTask(void *arg)
{
    int prio = *(int*)arg;
    cbQueueSet *mySet = &callbackQueue[prio];

    taskwdInsert(0, NULL, NULL);
    epicsEventSignal(startStopEvent);

    while(!mySet->shutdown) {
        void *ptr;
        if (epicsRingPointerIsEmpty(mySet->queue))
            epicsEventMustWait(mySet->semWakeUp);

        while ((ptr = epicsRingPointerPop(mySet->queue))) {
            CALLBACK *pcallback = (CALLBACK *)ptr;
            if(!epicsRingPointerIsEmpty(mySet->queue))
                epicsEventMustTrigger(mySet->semWakeUp);
            mySet->queueOverflow = FALSE;
            (*pcallback->callback)(pcallback);
        }
    }

    if(!epicsAtomicDecrIntT(&mySet->threadsRunning))
        epicsEventSignal(startStopEvent);
    taskwdRemove(0);
}
开发者ID:ukaea,项目名称:epics,代码行数:26,代码来源:callback.c

示例5: setIntegerParam

/** Called when asyn clients call pasynInt32->write().
  * This function performs actions for some parameters, including ADAcquire, mar345Erase, etc.
  * For all parameters it sets the value in the parameter library and calls any registered callbacks..
  * \param[in] pasynUser pasynUser structure that encodes the reason and address.
  * \param[in] value Value to write. */
asynStatus mar345::writeInt32(asynUser *pasynUser, epicsInt32 value)
{
    int function = pasynUser->reason;
    asynStatus status = asynSuccess;
    const char *functionName = "writeInt32";

    status = setIntegerParam(function, value);

    if (function == ADAcquire) {
        if (value && (this->mode == mar345ModeIdle)) {
            /* Send an event to wake up the mar345 task.  */
            this->mode = mar345ModeAcquire;
            epicsEventSignal(this->startEventId);
        } 
        if (!value && (this->mode != mar345ModeIdle)) {
            /* Stop acquiring (ends exposure, does not abort) */
            epicsEventSignal(this->stopEventId);
        }
    } else if (function == mar345Erase) {
        if (value && (this->mode == mar345ModeIdle)) {
            this->mode = mar345ModeErase;
            /* Send an event to wake up the mar345 task.  */
            epicsEventSignal(this->startEventId);
        } 
    } else if (function == mar345ChangeMode) {
        if (value && (this->mode == mar345ModeIdle)) {
           this->mode = mar345ModeChange;
            /* Send an event to wake up the mar345 task.  */
            epicsEventSignal(this->startEventId);
        } 
    } else if (function == mar345Abort) {
        if (value && (this->mode != mar345ModeIdle)) {
            /* Abort operation */
            setIntegerParam(ADStatus, mar345StatusAborting);
            epicsEventSignal(this->abortEventId);
        }
    } else {
        /* If this is not a parameter we have handled call the base class */
        if (function < FIRST_MAR345_PARAM) status = ADDriver::writeInt32(pasynUser, value);
    }
        
    /* Do callbacks so higher layers see any changes */
    callParamCallbacks();
    
    if (status) 
        asynPrint(pasynUser, ASYN_TRACE_ERROR, 
              "%s:%s: error, status=%d function=%d, value=%d\n", 
              driverName, functionName, status, function, value);
    else        
        asynPrint(pasynUser, ASYN_TRACEIO_DRIVER, 
              "%s:%s: function=%d, value=%d\n", 
              driverName, functionName, function, value);
    return status;
}
开发者ID:NSLS-II-CSX,项目名称:xf23id1-ioc1,代码行数:59,代码来源:mar345.cpp

示例6: setIntegerParam

/** Called when asyn clients call pasynInt32->write().
  * This function performs actions for some parameters, including ADAcquire, ADTriggerMode, etc.
  * For all parameters it sets the value in the parameter library and calls any registered callbacks..
  * \param[in] pasynUser pasynUser structure that encodes the reason and address.
  * \param[in] value Value to write. */
asynStatus BISDetector::writeInt32(asynUser *pasynUser, epicsInt32 value)
{
    int function = pasynUser->reason;
    int adstatus;
    int maxSizeX;
    asynStatus status = asynSuccess;
    const char *functionName = "writeInt32";

    status = setIntegerParam(function, value);

    if (function == ADAcquire) {
        getIntegerParam(ADStatus, &adstatus);
        if (value && (adstatus == ADStatusIdle)) {
            /* Send an event to wake up the BIS task.  */
            epicsEventSignal(this->startEventId);
        } 
        if (!value && (adstatus != ADStatusIdle)) {
            /* This was a command to stop acquisition */
            epicsEventSignal(this->stopEventId);
        }
    } 
    else if (function == ADBinX) {
        getIntegerParam(ADMaxSizeX, &maxSizeX);
        if ((value == 1) || (value == 2) || (value == 4) || (value == 8)) {
            /* There is only 1 binning, set X and Y the same */
            setIntegerParam(ADBinY, value);
            epicsSnprintf(this->toBIS, sizeof(this->toBIS), 
                "[ChangeFrameSize /FrameSize=%d]", maxSizeX/value);
            writeBIS(BIS_DEFAULT_TIMEOUT);
        } else {
            asynPrint(pasynUserSelf, ASYN_TRACE_ERROR,
                "%s:%s: invalid binning=%d, must be 1,2,4 or 8\n",
                driverName, functionName, value);
            status = asynError;
        } 
    } else {
        /* If this parameter belongs to a base class call its method */
        if (function < FIRST_BIS_PARAM) status = ADDriver::writeInt32(pasynUser, value);
    }
            
    /* Do callbacks so higher layers see any changes */
    callParamCallbacks();
    
    if (status) 
        asynPrint(pasynUser, ASYN_TRACE_ERROR, 
              "%s:%s: error, status=%d function=%d, value=%d\n", 
              driverName, functionName, status, function, value);
    else        
        asynPrint(pasynUser, ASYN_TRACEIO_DRIVER, 
              "%s:%s: function=%d, value=%d\n", 
              driverName, functionName, function, value);
    return status;
}
开发者ID:ISISComputingGroup,项目名称:EPICS-areaDetector,代码行数:58,代码来源:BISDetector.cpp

示例7: seq_pvGetComplete

/*
 * Return whether the last get completed. In safe mode, as a
 * side effect, copy value from shared buffer to state set local buffer.
 */
epicsShareFunc boolean epicsShareAPI seq_pvGetComplete(SS_ID ss, VAR_ID varId)
{
	epicsEventId	getSem = ss->getSemId[varId];
	SPROG		*sp = ss->sprog;
	CHAN		*ch = sp->chan + varId;
	pvStat		status;

	if (!ch->dbch)
	{
		/* Anonymous PVs always complete immediately */
		if (!(sp->options & OPT_SAFE))
			errlogSevPrintf(errlogMajor,
				"pvGetComplete(%s): user error (variable not assigned)\n",
				ch->varName);
		return TRUE;
	}

	if (!ss->getReq[varId])
	{
		errlogSevPrintf(errlogMinor,
			"pvGetComplete(%s): no pending get request for this variable\n",
			ch->varName);
		return TRUE;
	}

	switch (epicsEventTryWait(getSem))
	{
	case epicsEventWaitOK:
		ss->getReq[varId] = NULL;
		epicsEventSignal(getSem);
		status = check_connected(ch->dbch, metaPtr(ch,ss));
		/* TODO: returning either TRUE or FALSE here seems wrong. We return TRUE,
		   so that state sets don't hang. Still means that user code has to check
		   status by calling pvStatus and/or pvMessage. */
		if (status) return TRUE;
		/* In safe mode, copy value and meta data from shared buffer
		   to ss local buffer. */
		if (sp->options & OPT_SAFE)
			/* Copy regardless of whether dirty flag is set or not */
			ss_read_buffer(ss, ch, FALSE);
		return TRUE;
	case epicsEventWaitTimeout:
		return FALSE;
	case epicsEventWaitError:
		ss->getReq[varId] = NULL;
		epicsEventSignal(getSem);
		errlogSevPrintf(errlogFatal, "pvGetComplete: "
		  "epicsEventTryWait(getSemId[%d]) failure\n", varId);
	default: /* pacify gcc which does not understand the we checked all possibilities */
		return FALSE;
	}
}
开发者ID:A2-Collaboration,项目名称:epics,代码行数:56,代码来源:seq_if.c

示例8: postjobs

/* Starts "mcnt" jobs in a pool with initial and max
 * thread counts "icnt" and "mcnt".
 * The test ensures that all jobs run in parallel.
 * "cork" checks the function of pausing the run queue
 * with epicsThreadPoolQueueRun
 */
static void postjobs(size_t icnt, size_t mcnt, int cork)
{
    size_t i;
    epicsThreadPool *pool;
    countPriv *priv=callocMustSucceed(1, sizeof(*priv), "postjobs priv alloc");
    priv->guard=epicsMutexMustCreate();
    priv->done=epicsEventMustCreate(epicsEventEmpty);
    priv->allrunning=epicsEventMustCreate(epicsEventEmpty);
    priv->count=mcnt;
    priv->job=callocMustSucceed(mcnt, sizeof(*priv->job), "postjobs job array");

    testDiag("postjobs(%lu,%lu)", (unsigned long)icnt, (unsigned long)mcnt);

    {
        epicsThreadPoolConfig conf;
        epicsThreadPoolConfigDefaults(&conf);
        conf.initialThreads=icnt;
        conf.maxThreads=mcnt;

        testOk1((pool=epicsThreadPoolCreate(&conf))!=NULL);
        if(!pool)
            return;
    }

    if(cork)
        epicsThreadPoolControl(pool, epicsThreadPoolQueueRun, 0);

    for(i=0; i<mcnt; i++) {
        testDiag("i=%lu", (unsigned long)i);
        priv->job[i] = epicsJobCreate(pool, &countjob, priv);
        testOk1(priv->job[i]!=NULL);
        testOk1(epicsJobQueue(priv->job[i])==0);
    }

    if(cork) {
        /* no jobs should have run */
        epicsMutexMustLock(priv->guard);
        testOk1(priv->count==mcnt);
        epicsMutexUnlock(priv->guard);

        epicsThreadPoolControl(pool, epicsThreadPoolQueueRun, 1);
    }

    testDiag("Waiting for all jobs to start");
    epicsEventMustWait(priv->allrunning);
    testDiag("Stop all");
    epicsEventSignal(priv->done);

    for(i=0; i<mcnt; i++) {
        testDiag("i=%lu", (unsigned long)i);
        epicsJobDestroy(priv->job[i]);
    }

    epicsThreadPoolDestroy(pool);
    epicsMutexDestroy(priv->guard);
    epicsEventDestroy(priv->allrunning);
    epicsEventDestroy(priv->done);
    free(priv->job);
    free(priv);
}
开发者ID:epicsdeb,项目名称:epics-base,代码行数:66,代码来源:epicsThreadPoolTest.c

示例9: setIntegerParam

/** Called when asyn clients call pasynInt32->write().
  * This function sends a signal to the arrayGenTask thread if the value of P_RunStop has changed.
  * For all parameters it sets the value in the parameter library and calls any registered callbacks..
  * \param[in] pasynUser pasynUser structure that encodes the reason and address.
  * \param[in] value Value to write. */
asynStatus testArrayRingBuffer::writeInt32(asynUser *pasynUser, epicsInt32 value)
{
    int function = pasynUser->reason;
    asynStatus status = asynSuccess;
    const char *paramName;
    const char* functionName = "writeInt32";

    /* Set the parameter in the parameter library. */
    status = (asynStatus) setIntegerParam(function, value);
    
    /* Fetch the parameter string name for possible use in debugging */
    getParamName(function, &paramName);

    if (function == P_RunStop) {
        if (value) epicsEventSignal(eventId_);
    } 
    else {
        /* All other parameters just get set in parameter list, no need to
         * act on them here */
    }
    
    /* Do callbacks so higher layers see any changes */
    status = (asynStatus) callParamCallbacks();
    
    if (status) 
        epicsSnprintf(pasynUser->errorMessage, pasynUser->errorMessageSize, 
                  "%s:%s: status=%d, function=%d, name=%s, value=%d", 
                  driverName, functionName, status, function, paramName, value);
    else        
        asynPrint(pasynUser, ASYN_TRACEIO_DRIVER, 
              "%s:%s: function=%d, name=%s, value=%d\n", 
              driverName, functionName, function, paramName, value);
    return status;
}
开发者ID:FreddieAkeroyd,项目名称:asyn,代码行数:39,代码来源:testArrayRingBuffer.cpp

示例10: scanShutdown

void scanShutdown(void)
{
    int i;

    if (scanCtl == ctlExit) return;
    scanCtl = ctlExit;

    interruptAccept = FALSE;

    for (i = 0; i < nPeriodic; i++) {
        papPeriodic[i]->scanCtl = ctlExit;
        epicsEventSignal(papPeriodic[i]->loopEvent);
        epicsEventWait(startStopEvent);
    }

    scanOnce((dbCommon *)&exitOnce);
    epicsEventWait(startStopEvent);

    deletePeriodic();
    ioscanDestroy();

    epicsRingPointerDelete(onceQ);

    epicsEventDestroy(startStopEvent);
    epicsEventDestroy(onceSem);
    onceSem = startStopEvent = NULL;

    free(periodicTaskId);
    papPeriodic = NULL;
    periodicTaskId = NULL;
}
开发者ID:T-A-R-L-A,项目名称:EPICS-Base,代码行数:31,代码来源:dbScan.c

示例11: dbCaPause

void dbCaPause(void)
{
    if (dbCaCtl == ctlRun) {
        dbCaCtl = ctlPause;
        epicsEventSignal(workListEvent);
    }
}
开发者ID:T-A-R-L-A,项目名称:EPICS-Base,代码行数:7,代码来源:dbCa.c

示例12: motorAxisHome

static int motorAxisHome(AXIS_HDL pAxis, double min_velocity, double max_velocity, double acceleration, int forwards)
{
    int status;
    char buff[100];

    if (pAxis == NULL)
        return MOTOR_AXIS_ERROR;

    PRINT(pAxis->logParam, FLOW, "motorAxisHome: set card %d, axis %d to home\n",
          pAxis->card, pAxis->axis);

    sprintf(buff, "%dAC%.*f; %dVA%.*f;%dOR;",
            pAxis->axis+1, pAxis->maxDigits, acceleration * pAxis->stepSize,
            pAxis->axis+1, pAxis->maxDigits, max_velocity * pAxis->stepSize,
            pAxis->axis+1);
    status = sendOnly(pAxis->pController, buff);
    if (status)
        return(MOTOR_AXIS_ERROR);

    if (epicsMutexLock(pAxis->mutexId) == epicsMutexLockOK)
    {
        /* Insure that the motor record's next status update sees motorAxisDone = False. */
        motorParam->setInteger(pAxis->params, motorAxisDone, 0);
        motorParam->callCallback(pAxis->params);
        epicsMutexUnlock(pAxis->mutexId);
    }

    /* Send a signal to the poller task which will make it do a poll, and switch to the moving poll rate */
    epicsEventSignal(pAxis->pController->pollEventId);
    return MOTOR_AXIS_OK;
}
开发者ID:mark0n,项目名称:motorRecord,代码行数:31,代码来源:drvMM4000Asyn.c

示例13: addAction

static void addAction(caLink *pca, short link_action)
{
    int callAdd;

    epicsMutexMustLock(workListLock);
    callAdd = (pca->link_action == 0);
    if (pca->link_action & CA_CLEAR_CHANNEL) {
        errlogPrintf("dbCa::addAction %d with CA_CLEAR_CHANNEL set\n",
            link_action);
        printLinks(pca);
        link_action = 0;
    }
    if (link_action & CA_CLEAR_CHANNEL) {
        if (++removesOutstanding >= removesOutstandingWarning) {
            errlogPrintf("dbCa::addAction pausing, %d channels to clear\n",
                removesOutstanding);
            printLinks(pca);
        }
        while (removesOutstanding >= removesOutstandingWarning) {
            epicsMutexUnlock(workListLock);
            epicsThreadSleep(1.0);
            epicsMutexMustLock(workListLock);
        }
    }
    pca->link_action |= link_action;
    if (callAdd)
        ellAdd(&workList, &pca->node);
    epicsMutexUnlock(workListLock);
    if (callAdd)
        epicsEventSignal(workListEvent);
}
开发者ID:T-A-R-L-A,项目名称:EPICS-Base,代码行数:31,代码来源:dbCa.c

示例14: InterruptHandler

void omsMAXv::InterruptHandler( void * param )
{
    omsMAXv* pController = (omsMAXv*) param;
    volatile struct MAXv_motor *pmotor = (MAXv_motor*) pController->getCardAddress();;
    STATUS1 status1_flag;
    static char errmsg[65];

    status1_flag.All = pmotor->status1_flag.All;

    /* Motion done handling */
    if (status1_flag.Bits.done != 0) epicsEventSignal(pController->pollEventId_);

    if (status1_flag.Bits.cmndError)
    {
        strcpy(errmsg, "\nomsMAXv::InterruptHandler: command error - Port: ");
        strncat(errmsg, pController->getPortName(), sizeof(errmsg)-strlen(errmsg)-2);
        strcat(errmsg,"\n");
        epicsInterruptContextMessage(errmsg);
    }

    /* unset this bit to not clear the text_response bit */
    if (status1_flag.Bits.text_response != 0)  status1_flag.Bits.text_response = 0;

    /* Release IRQ's. Clear bits by writing a 1 */
    pmotor->status1_flag.All = status1_flag.All;

    /* do a dummy read to ensure that all previous writes, which may
     * have been queued in the VME bridge chip get processed
     */
    status1_flag.All = pmotor->status1_flag.All;

}
开发者ID:Brudhu,项目名称:motor,代码行数:32,代码来源:omsMAXv.cpp

示例15: func_EC1_ANT_SYS_RUN

void func_EC1_ANT_SYS_RUN(void *pArg, double arg1, double arg2)
{
	ST_STD_device* pSTDdev = (ST_STD_device *)pArg;

	if ( (int)arg1   ) 
	{
		if( check_dev_run_condition(pSTDdev)== WR_ERROR) 
			return;

		/* to do here */
		epicsEventSignal( pSTDdev->ST_RTthread.threadEventId );

		pSTDdev->StatusDev |= TASK_IN_PROGRESS;
		notify_error(ERR_SCN, "no error\n");
	}
	else 
	{
		if( check_dev_stop_condition(pSTDdev) == WR_ERROR) 
			return;

		pSTDdev->StatusDev &= ~TASK_IN_PROGRESS;
		pSTDdev->StatusDev &= ~TASK_WAIT_FOR_TRIGGER;
		notify_error(ERR_SCN, "no error\n");
	}
}
开发者ID:Sangil-Lee,项目名称:RefCode,代码行数:25,代码来源:drvEC1_ANT.c


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