本文整理汇总了C++中epicsThreadCreate函数的典型用法代码示例。如果您正苦于以下问题:C++ epicsThreadCreate函数的具体用法?C++ epicsThreadCreate怎么用?C++ epicsThreadCreate使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了epicsThreadCreate函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: drvRFCTRL_Configure
int drvRFCTRL_Configure(int start, char *ip, int port)
{
int i;
epicsPrintf("*** RF CTRL START ***\n");
sprintf(lhcd_rfctrl.ip, "%s", ip);
lhcd_rfctrl.sock = set_up_tcp( ip, RFCTRL_PORT);
if(lhcd_rfctrl.sock >= 0) lhcd_rfctrl.con_stat = 1;
epicsPrintf("*** RF CTRL Connection OK ***\n");
lhcd_rfctrl.mds_status = 0;
lhcd_rfctrl.t0 = 0.0;
epicsThreadCreate("RFCTRL",
epicsThreadPriorityHigh,
epicsThreadGetStackSize(epicsThreadStackSmall),
(EPICSTHREADFUNC)GetRFCTRL_Data_Thread, &lhcd_rfctrl);
epicsThreadCreate("RFCTRL",
epicsThreadPriorityHigh,
epicsThreadGetStackSize(epicsThreadStackSmall),
(EPICSTHREADFUNC)PutRFCTRL_MDS_Thread, &lhcd_rfctrl);
return 0;
}
开发者ID:Sangil-Lee,项目名称:RefCode,代码行数:29,代码来源:drvRFCTRL.c
示例2: Run_mode
int
Run_mode(acqMaster_t *master)
{
acqEvent_t *ev;
acqScan_t *sc;
char threadName[50];
master->acqRuns = 1;
master->globalShutdown = 0;
master->globalPause = 0;
for( ev = first_acqEvent(master); ev ; ev = next_acqEvent(ev) )
{
snprintf(threadName, sizeof threadName, "event_%s", ev->eventName);
ev->outputCount = 0;
ev->state = AS_STARTUP;
ev->threadID = epicsThreadCreate(threadName, epicsThreadPriorityMedium, epicsThreadGetStackSize(epicsThreadStackMedium), (EPICSTHREADFUNC)runEvent, ev);
}
for( sc = first_acqScan(master) ; sc ; sc = next_acqScan(sc) )
{
snprintf(threadName, sizeof threadName, "scan_%s", sc->scanName);
sc->state = AS_STARTUP;
sc->threadID = epicsThreadCreate(threadName, epicsThreadPriorityMedium, epicsThreadGetStackSize(epicsThreadStackMedium), (EPICSTHREADFUNC)runAcqScan, sc);
}
master->putMode(master, AS_RUNUP);
master->messageAdd(master, "Run Mode");
return 0;
}
开发者ID:Cpppro,项目名称:acquaman,代码行数:30,代码来源:acqActSetup.c
示例3: errlogInitPvt
static void errlogInitPvt(void *arg)
{
struct initArgs *pconfig = (struct initArgs *) arg;
epicsThreadId tid;
pvtData.errlogInitFailed = TRUE;
pvtData.buffersize = pconfig->bufsize;
pvtData.maxMsgSize = pconfig->maxMsgSize;
pvtData.msgNeeded = adjustToWorstCaseAlignment(pvtData.maxMsgSize +
sizeof(msgNode));
ellInit(&pvtData.listenerList);
ellInit(&pvtData.msgQueue);
pvtData.toConsole = TRUE;
pvtData.console = stderr;
pvtData.waitForWork = epicsEventMustCreate(epicsEventEmpty);
pvtData.listenerLock = epicsMutexMustCreate();
pvtData.msgQueueLock = epicsMutexMustCreate();
pvtData.waitForFlush = epicsEventMustCreate(epicsEventEmpty);
pvtData.flush = epicsEventMustCreate(epicsEventEmpty);
pvtData.flushLock = epicsMutexMustCreate();
pvtData.waitForExit = epicsEventMustCreate(epicsEventEmpty);
pvtData.pbuffer = callocMustSucceed(1, pvtData.buffersize,
"errlogInitPvt");
errSymBld(); /* Better not to do this lazily... */
tid = epicsThreadCreate("errlog", epicsThreadPriorityLow,
epicsThreadGetStackSize(epicsThreadStackSmall),
(EPICSTHREADFUNC)errlogThread, 0);
if (tid) {
pvtData.errlogInitFailed = FALSE;
}
}
开发者ID:T-A-R-L-A,项目名称:EPICS-Base,代码行数:33,代码来源:errlog.c
示例4: asynMotorController
motorSimController::motorSimController(const char *portName, int numAxes, int priority, int stackSize)
: asynMotorController(portName, numAxes, NUM_SIM_CONTROLLER_PARAMS,
asynInt32Mask | asynFloat64Mask,
asynInt32Mask | asynFloat64Mask,
ASYN_CANBLOCK | ASYN_MULTIDEVICE,
1, // autoconnect
priority, stackSize)
{
int axis;
motorSimControllerNode *pNode;
if (!motorSimControllerListInitialized) {
motorSimControllerListInitialized = 1;
ellInit(&motorSimControllerList);
}
// We should make sure this portName is not already in the list */
pNode = (motorSimControllerNode*) calloc(1, sizeof(motorSimControllerNode));
pNode->portName = epicsStrDup(portName);
pNode->pController = this;
ellAdd(&motorSimControllerList, (ELLNODE *)pNode);
if (numAxes < 1 ) numAxes = 1;
numAxes_ = numAxes;
this->movesDeferred_ = 0;
for (axis=0; axis<numAxes; axis++) {
new motorSimAxis(this, axis, DEFAULT_LOW_LIMIT, DEFAULT_HI_LIMIT, DEFAULT_HOME, DEFAULT_START);
setDoubleParam(axis, this->motorPosition_, DEFAULT_START);
}
this->motorThread_ = epicsThreadCreate("motorSimThread",
epicsThreadPriorityLow,
epicsThreadGetStackSize(epicsThreadStackMedium),
(EPICSTHREADFUNC) motorSimTaskC, (void *) this);
}
开发者ID:dchabot,项目名称:motor-synapps,代码行数:35,代码来源:motorSimDriver.cpp
示例5: make_ringThreadConfig
static drvM6802_controlThreadConfig* make_ringThreadConfig(drvM6802_taskConfig *ptaskConfig)
{
drvM6802_controlThreadConfig *pringThreadConfig = NULL;
pringThreadConfig = (drvM6802_controlThreadConfig*)malloc(sizeof(drvM6802_controlThreadConfig));
if(!pringThreadConfig) return pringThreadConfig;
sprintf(pringThreadConfig->threadName, "RING_ctrl");
pringThreadConfig->threadPriority = epicsThreadPriorityLow;
pringThreadConfig->threadStackSize = epicsThreadGetStackSize(epicsThreadStackBig);
pringThreadConfig->threadFunc = (EPICSTHREADFUNC) RingThreadFunc;
pringThreadConfig->threadParam = (void*) ptaskConfig;
/* pringThreadConfig->threadQueueId = epicsMessageQueueCreate(100,sizeof(controlThreadQueueData)); */
pringThreadConfig->threadQueueId = 0; /* we don't need this */
/* if(pringThreadConfig->threadQueueId) ptaskConfig->taskStatus |= TASK_CONTQUEUE; */
epicsThreadCreate(pringThreadConfig->threadName,
pringThreadConfig->threadPriority,
pringThreadConfig->threadStackSize,
(EPICSTHREADFUNC) pringThreadConfig->threadFunc,
(void*) pringThreadConfig->threadParam);
return pringThreadConfig;
}
开发者ID:Sangil-Lee,项目名称:RefCode,代码行数:26,代码来源:drvM6802.c
示例6: dbtpn
long dbtpn(char *pname, char *pvalue)
{
struct dbChannel *chan;
tpnInfo *ptpnInfo;
processNotify *ppn=NULL;
chan = dbChannelCreate(pname);
if (!chan) {
printf("dbtpn: No such channel");
return -1;
}
ppn = dbCalloc(1, sizeof(processNotify));
ppn->requestType = pvalue ? putProcessRequest : processGetRequest;
ppn->chan = chan;
ppn->putCallback = putCallback;
ppn->getCallback = getCallback;
ppn->doneCallback = doneCallback;
ptpnInfo = dbCalloc(1, sizeof(tpnInfo));
ptpnInfo->ppn = ppn;
ptpnInfo->callbackDone = epicsEventCreate(epicsEventEmpty);
strncpy(ptpnInfo->buffer, pvalue, 80);
ptpnInfo->buffer[79] = 0;
ppn->usrPvt = ptpnInfo;
epicsThreadCreate("dbtpn", epicsThreadPriorityHigh,
epicsThreadGetStackSize(epicsThreadStackMedium), tpnThread, ptpnInfo);
return 0;
}
开发者ID:epicsdeb,项目名称:epics-base,代码行数:30,代码来源:dbNotify.c
示例7: asynPortDriver
/// Constructor for the #NetShrVarDriver class.
/// Calls constructor for the asynPortDriver base class and sets up driver parameters.
///
/// @param[in] netvarint interface pointer created by NetShrVarConfigure()
/// @param[in] poll_ms @copydoc initArg0
/// @param[in] portName @copydoc initArg3
NetShrVarDriver::NetShrVarDriver(NetShrVarInterface* netvarint, int poll_ms, const char *portName)
: asynPortDriver(portName,
0, /* maxAddr */
static_cast<int>(netvarint->nParams()),
asynInt32Mask | asynInt32ArrayMask | asynFloat64Mask | asynFloat64ArrayMask | asynOctetMask | asynDrvUserMask, /* Interface mask */
asynInt32Mask | asynInt32ArrayMask | asynFloat64Mask | asynFloat64ArrayMask | asynOctetMask, /* Interrupt mask */
ASYN_CANBLOCK, /* asynFlags. This driver can block but it is not multi-device */
1, /* Autoconnect */
0, /* Default priority */
0), /* Default stack size*/
m_netvarint(netvarint), m_poll_ms(poll_ms), m_shutting_down(false)
{
const char *functionName = "NetShrVarDriver";
m_netvarint->createParams(this);
if (poll_ms == 0)
{
std::cerr << "Warning: driver is not polling for buffered reads, only subscribers will see changes" << std::endl;
}
epicsAtExit(epicsExitFunc, this);
// Create the thread for background tasks (not used at present, could be used for I/O intr scanning)
if (epicsThreadCreate("NetShrVarDriverTask",
epicsThreadPriorityMedium,
epicsThreadGetStackSize(epicsThreadStackMedium),
(EPICSTHREADFUNC)NetShrVarTask, this) == 0)
{
printf("%s:%s: epicsThreadCreate failure\n", driverName, functionName);
return;
}
}
开发者ID:ISISComputingGroup,项目名称:EPICS-NetShrVar,代码行数:37,代码来源:NetShrVarDriver.cpp
示例8: mdsPlusPut
long mdsPlusPut( genSubRecord *pgsub )
{
/*char *buf = (char *)calloc(40, sizeof(char));*/
int i;
int nextPos = 0;
/* if notified new pulse set taskPos = 0 and notify next access will not be new */
if(notifyNewPulse) {
taskPos = 0;
notifyNewPulse = 0;
}
/* if startMdsPut is active, do nothing */
if(startMdsPut) {
return(0);
}
nextPos = taskPos;
pmdsPutData[nextPos].plinkout = pgsub->outa;
/*buf = (char *)pgsub->a;
sscanf(buf,"%s %s",pmdsPutData[nextPos].serverID, pmdsPutData[nextPos].treeID);
buf = (char *)pgsub->g;
sscanf(buf,"%s",pmdsPutData[nextPos].tagName);*/
sscanf(pgsub->a,"%s %s",pmdsPutData[nextPos].serverID, pmdsPutData[nextPos].treeID);
sscanf(pgsub->g,"%s",pmdsPutData[nextPos].tagName);
/* check shot number */
pmdsPutData[nextPos].shotID = *((unsigned long *)pgsub->b);
pmdsPutData[nextPos].noRd = *((unsigned long *)pgsub->c);
/* check dT and offT */
pmdsPutData[nextPos].dT = *((float *)pgsub->d);
pmdsPutData[nextPos].offT = *((float *)pgsub->e);
/* check the node is valid */
pmdsPutData[nextPos].putFlag = *((unsigned long *)pgsub->h);
if(genSubDebug > 0)
printf("genSub: Ready mdsPlusPut() shotID=%lu,treeID=%s,serverID=%s,tagName=%s, noRd=%lu\n",
pmdsPutData[nextPos].shotID, pmdsPutData[nextPos].treeID, pmdsPutData[nextPos].serverID,
pmdsPutData[nextPos].tagName, pmdsPutData[nextPos].noRd);
/* alocate data memory by noRd */
/*pmdsPutData[nextPos].dataArray = (float *)calloc(pmdsPutData[nextPos].noRd, sizeofTypes[pgsub->ftf]);*/
pmdsPutData[nextPos].dataArray = (float *)realloc(pmdsPutData[nextPos].dataArray,
pmdsPutData[nextPos].noRd * sizeofTypes[pgsub->ftf]);
/* put data */
memcpy(pmdsPutData[nextPos].dataArray, pgsub->f, pmdsPutData[nextPos].noRd*sizeof(sizeofTypes[pgsub->ftf]));
/* if taskPos is equal to the numNode-1, start mdsput and notify new pulse for next access.*/
if(taskPos == numNode - 1 ) {
notifyNewPulse = 1;
startMdsPut = 1;
epicsThreadCreate("mdsPlusPutTask",
epicsThreadPriorityLow,
epicsThreadGetStackSize(epicsThreadStackMedium),
(EPICSTHREADFUNC) mdsPlusPut_Task,
0);
} else {
taskPos = (taskPos+1)&0xf;
}
/*free(buf);*/
return(pmdsPutData[nextPos].noRd);
}
开发者ID:Sangil-Lee,项目名称:RefCode,代码行数:60,代码来源:waveformGenSub.c
示例9: iocExit
/**
* @ingroup asub_functions
* @param[in] prec Pointer to aSub record
*/
static long iocExit(aSubRecord *prec)
{
long stat = *(long*)prec->a;
epicsThreadCreate("iocExit", epicsThreadPriorityMedium,
epicsThreadGetStackSize(epicsThreadStackMedium), exitFunc, (void*)stat);
return 0; /* process output links */
}
开发者ID:ISISComputingGroup,项目名称:EPICS-asubFunctions,代码行数:11,代码来源:iocExit.c
示例10: print_channelConfig
/*
static void print_channelConfig(drvM6802_taskConfig *ptaskConfig, int level)
{
drvM6802_channelConfig *pchannelConfig;
pchannelConfig = (drvM6802_channelConfig*) ellFirst(ptaskConfig->pchannelConfig);
while(pchannelConfig) {
epicsPrintf(" %s", pchannelConfig->chanName);
if(level>2) {
epicsPrintf("\tChannel, status: 0x%x, index: %d, gain: %f",
pchannelConfig->channelStatus,
pchannelConfig->chanIndex,
pchannelConfig->gain );
if(level>3) {
epicsPrintf(", conv.T: %f usec", pchannelConfig->conversionTime_usec);
}
}
epicsPrintf("\n");
pchannelConfig = (drvM6802_channelConfig*) ellNext(&pchannelConfig->node);
}
return;
}
*/
static drvM6802_controlThreadConfig* make_controlThreadConfig(drvM6802_taskConfig *ptaskConfig)
{
drvM6802_controlThreadConfig *pcontrolThreadConfig = NULL;
pcontrolThreadConfig = (drvM6802_controlThreadConfig*)malloc(sizeof(drvM6802_controlThreadConfig));
if(!pcontrolThreadConfig) return pcontrolThreadConfig;
sprintf(pcontrolThreadConfig->threadName, "%s_ctrl", ptaskConfig->taskName);
pcontrolThreadConfig->threadPriority = epicsThreadPriorityLow;
pcontrolThreadConfig->threadStackSize = epicsThreadGetStackSize(epicsThreadStackSmall);
pcontrolThreadConfig->threadFunc = (EPICSTHREADFUNC) controlThreadFunc;
pcontrolThreadConfig->threadParam = (void*) ptaskConfig;
pcontrolThreadConfig->threadQueueId = epicsMessageQueueCreate(100,sizeof(controlThreadQueueData));
epicsThreadCreate(pcontrolThreadConfig->threadName,
pcontrolThreadConfig->threadPriority,
pcontrolThreadConfig->threadStackSize,
(EPICSTHREADFUNC) pcontrolThreadConfig->threadFunc,
(void*) pcontrolThreadConfig->threadParam);
return pcontrolThreadConfig;
}
开发者ID:Sangil-Lee,项目名称:RefCode,代码行数:51,代码来源:drvM6802.c
示例11: asynPortDriver
/// Constructor for the isisdaeDriver class.
/// Calls constructor for the asynPortDriver base class.
/// \param[in] dcomint DCOM interface pointer created by lvDCOMConfigure()
/// \param[in] portName @copydoc initArg0
daedataDriver::daedataDriver(const char *portName, const char* host)
: asynPortDriver(portName,
0, /* maxAddr */
NUM_ISISDAE_PARAMS,
asynInt32Mask | asynInt32ArrayMask | asynDrvUserMask, /* Interface mask */
asynInt32Mask | asynInt32ArrayMask, /* Interrupt mask */
ASYN_CANBLOCK , /* asynFlags. This driver can block but it is not multi-device */
1, /* Autoconnect */
0, /* Default priority */
0) /* Default stack size*/
{
const char *functionName = "daedataDriver";
// epicsThreadOnce(&onceId, initCOM, NULL);
m_udp = new DAEDataUDP(host);
createParam(P_SVN_VERSIONString, asynParamInt32, &P_SVN_VERSION);
createParam(P_FIRMWARE_VERSIONString, asynParamInt32, &P_FIRMWARE_VERSION);
createParam(P_CHANNEL_POSITIONString, asynParamInt32Array, &P_CHANNEL_POSITION);
// Create the thread for background tasks (not used at present, could be used for I/O intr scanning)
if (epicsThreadCreate("isisdaePoller",
epicsThreadPriorityMedium,
epicsThreadGetStackSize(epicsThreadStackMedium),
(EPICSTHREADFUNC)pollerThreadC, this) == 0)
{
printf("%s:%s: epicsThreadCreate failure\n", driverName, functionName);
return;
}
}
开发者ID:ISISComputingGroup,项目名称:EPICS-isisdaedata,代码行数:34,代码来源:daedataDriver.cpp
示例12: make_fpdpThreadConfig
static drvM6802_controlThreadConfig* make_fpdpThreadConfig(drvM6802_taskConfig *ptaskConfig)
{
drvM6802_controlThreadConfig *pfpdpThreadConfig = NULL;
pfpdpThreadConfig = (drvM6802_controlThreadConfig*)malloc(sizeof(drvM6802_controlThreadConfig));
if(!pfpdpThreadConfig) return pfpdpThreadConfig;
sprintf(pfpdpThreadConfig->threadName, "FPDP_ctrl");
pfpdpThreadConfig->threadPriority = epicsThreadPriorityHigh;
pfpdpThreadConfig->threadStackSize = epicsThreadGetStackSize(epicsThreadStackBig);
pfpdpThreadConfig->threadFunc = (EPICSTHREADFUNC) FPDPthreadFunc;
pfpdpThreadConfig->threadParam = (void*) ptaskConfig;
pfpdpThreadConfig->threadQueueId = epicsMessageQueueCreate(100,sizeof(bufferingThreadQueueData));
bufferingQueueID = pfpdpThreadConfig->threadQueueId;
/* pfpdpThreadConfig->threadQueueId = 0; */
/* if(pfpdpThreadConfig->threadQueueId) ptaskConfig->taskStatus |= TASK_CONTQUEUE; */
epicsThreadCreate(pfpdpThreadConfig->threadName,
pfpdpThreadConfig->threadPriority,
pfpdpThreadConfig->threadStackSize,
(EPICSTHREADFUNC) pfpdpThreadConfig->threadFunc,
(void*) pfpdpThreadConfig->threadParam);
return pfpdpThreadConfig;
}
开发者ID:Sangil-Lee,项目名称:RefCode,代码行数:27,代码来源:drvM6802.c
示例13: ClockTime_Init
void ClockTime_Init(int synchronize)
{
int firstTime = 0;
epicsThreadOnce(&onceId, ClockTime_InitOnce, &firstTime);
if (synchronize == CLOCKTIME_SYNC) {
if (ClockTimePvt.synchronize == CLOCKTIME_NOSYNC) {
/* Start synchronizing */
ClockTimePvt.synchronize = synchronize;
epicsThreadCreate("ClockTimeSync", epicsThreadPriorityHigh,
epicsThreadGetStackSize(epicsThreadStackSmall),
ClockTimeSync, NULL);
}
else {
/* No change, sync thread should already be running */
}
}
else {
if (ClockTimePvt.synchronize == CLOCKTIME_SYNC) {
/* Turn off synchronization thread */
ClockTime_Shutdown(NULL);
}
else {
/* No synchronization thread */
if (firstTime)
ClockTimeGetCurrent(&ClockTimePvt.startTime);
}
}
}
开发者ID:ukaea,项目名称:epics,代码行数:31,代码来源:osiClockTime.c
示例14: dbtpn
long epicsShareAPI dbtpn(char *pname,char *pvalue)
{
long status;
tpnInfo *ptpnInfo;
DBADDR *pdbaddr=NULL;
putNotify *ppn=NULL;
char *psavevalue;
int len;
len = strlen(pvalue);
/*allocate space for value immediately following DBADDR*/
pdbaddr = dbCalloc(1,sizeof(DBADDR) + len+1);
psavevalue = (char *)(pdbaddr + 1);
strcpy(psavevalue,pvalue);
status = dbNameToAddr(pname,pdbaddr);
if(status) {
errMessage(status, "dbtpn: dbNameToAddr");
free((void *)pdbaddr);
return(-1);
}
ppn = dbCalloc(1,sizeof(putNotify));
ppn->paddr = pdbaddr;
ppn->pbuffer = psavevalue;
ppn->nRequest = 1;
ppn->dbrType = DBR_STRING;
ppn->userCallback = dbtpnCallback;
ptpnInfo = dbCalloc(1,sizeof(tpnInfo));
ptpnInfo->ppn = ppn;
ptpnInfo->callbackDone = epicsEventCreate(epicsEventEmpty);
ppn->usrPvt = ptpnInfo;
epicsThreadCreate("dbtpn",epicsThreadPriorityHigh,
epicsThreadGetStackSize(epicsThreadStackMedium),
tpnThread,ptpnInfo);
return(0);
}
开发者ID:ukaea,项目名称:epics,代码行数:35,代码来源:dbNotify.c
示例15: asInitAsyn
int epicsShareAPI asInitAsyn(ASDBCALLBACK *pcallback)
{
if(!pacf) return(0);
if(asInitTheadId) {
errMessage(-1,"asInit: asInitTask already active");
if(pcallback) {
pcallback->status = S_asLib_InitFailed;
callbackRequest(&pcallback->callback);
}
return(-1);
}
asInitTheadId = epicsThreadCreate("asInitTask",
(epicsThreadPriorityCAServerHigh + 1),
epicsThreadGetStackSize(epicsThreadStackBig),
(EPICSTHREADFUNC)asInitTask,(void *)pcallback);
if(asInitTheadId==0) {
errMessage(0,"asInit: epicsThreadCreate Error");
if(pcallback) {
pcallback->status = S_asLib_InitFailed;
callbackRequest(&pcallback->callback);
}
asInitTheadId = 0;
}
return(0);
}
开发者ID:T-A-R-L-A,项目名称:EPICS-Base,代码行数:25,代码来源:asDbLib.c
示例16: drvSNMPConnInit
/* epicsShareFunc int drvSNMPConnInit(const char *version, const char *hostaddr, const char *username, const char *authpass, const char*privpass) */
epicsShareFunc int drvSNMPConnInit(char *version, char *hostaddr, char *username, char *authpass, char*privpass)
{
printf("------------------------------------------------\n");
printf("degug line\n");
printf("------------------------------------------------\n");
printf("version: %s, hostaddr: %s, username: %s, authpass: %s, privpass: %s\n",
version, hostaddr, username, authpass, privpass);
printf("------------------------------------------------\n");
snmpinfo = (SNMP_INFO *)malloc(sizeof(SNMP_INFO));
strcpy(&snmpinfo->version, version);
strcpy(&snmpinfo->hostaddr, hostaddr);
strcpy(&snmpinfo->username, username);
strcpy(&snmpinfo->authpass, authpass);
strcpy(&snmpinfo->privpass, privpass);
strcpy(&snmpinfo->msg,"Test Message");
gsnmpInfo = snmpinfo;
memcpy(gsnmpInfo, snmpinfo, sizeof(SNMP_INFO));
printf("version: %s, hostaddr: %s, username: %s, authpass: %s, privpass: %s\n",
snmpinfo->version, snmpinfo->hostaddr, snmpinfo->username, snmpinfo->authpass, snmpinfo->privpass);
ellInit(&devSNMPList);
epicsThreadCreate("drvSNMPConnInit", epicsThreadPriorityHigh, epicsThreadGetStackSize(epicsThreadStackSmall),
(EPICSTHREADFUNC)devSNMPScanThread,NULL);
return 0;
};
开发者ID:RaonControl,项目名称:siteLibs,代码行数:32,代码来源:snmpAsync_v3_problem.c
示例17: initialize
static long initialize()
{
epicsThreadId tid;
unsigned long cvtRecCnt = countCvtRecords();
if (!initConversionQ && cvtRecCnt > 0) {
initConversionQ = epicsMessageQueueCreate((unsigned)cvtRecCnt,
REINIT_MSG_SIZE);
if (!initConversionQ) {
nerrmsg("", "msgQCreate failed");
goto error;
}
tid = epicsThreadCreate("initCvt", epicsThreadPriorityLow, 20000,
(EPICSTHREADFUNC)initConversionTask, 0);
if (!tid) {
nerrmsg("", "taskSpawn failed");
goto error;
}
}
return 0;
error:
if (initConversionQ) epicsMessageQueueDestroy(initConversionQ);
return -1;
}
开发者ID:ISISComputingGroup,项目名称:EPICS-csm,代码行数:25,代码来源:cvtRecord.c
示例18: drvEtherIP_restart
/* (Re-)connect to IOC,
* (Re-)start scan tasks, one per PLC.
* Returns number of tasks spawned.
*/
int drvEtherIP_restart()
{
PLC *plc;
char taskname[20];
int tasks = 0;
size_t len;
if (drvEtherIP_private.lock == 0) return 0;
epicsMutexLock(drvEtherIP_private.lock);
if (!databaseIsReady) {
epicsMutexUnlock(drvEtherIP_private.lock);
for (plc = DLL_first(PLC,&drvEtherIP_private.PLCs);
plc; plc = DLL_next(PLC,plc))
{
if (plc->name)
{
EIP_printf(4, "drvEtherIP: Delaying launch of scan task for PLC '%s' until database ready\n",
plc->name);
}
}
return 0;
}
for (plc = DLL_first(PLC,&drvEtherIP_private.PLCs);
plc; plc = DLL_next(PLC,plc))
{
/* block scan task (if running): */
epicsMutexLock(plc->lock);
/* restart the connection:
* disconnect, PLC_scan_task will reconnect */
disconnect_PLC(plc);
/* check the scan task */
if (plc->scan_task_id==0)
{
len = strlen(plc->name);
if (len > 16)
len = 16;
taskname[0] = 'E';
taskname[1] = 'I';
taskname[2] = 'P';
memcpy(&taskname[3], plc->name, len);
taskname[len+3] = '\0';
plc->scan_task_id = epicsThreadCreate(
taskname,
epicsThreadPriorityHigh,
epicsThreadGetStackSize(epicsThreadStackMedium),
(EPICSTHREADFUNC)PLC_scan_task,
(void *)plc);
EIP_printf(5, "drvEtherIP: launch scan task for PLC '%s'\n",
plc->name);
++tasks;
}
epicsMutexUnlock(plc->lock);
}
epicsMutexUnlock(drvEtherIP_private.lock);
return tasks;
}
开发者ID:EPICSTools,项目名称:ether_ip,代码行数:62,代码来源:drvEtherIP.c
示例19: asynPortDriver
/** Constructor for the testErrors class.
* Calls constructor for the asynPortDriver base class.
* \param[in] portName The name of the asyn port driver to be created. */
testErrors::testErrors(const char *portName)
: asynPortDriver(portName,
1, /* maxAddr */
(int)NUM_PARAMS,
/* Interface mask */
asynInt32Mask | asynFloat64Mask | asynUInt32DigitalMask | asynOctetMask |
asynInt8ArrayMask | asynInt16ArrayMask | asynInt32ArrayMask | asynFloat32ArrayMask | asynFloat64ArrayMask |
asynOptionMask | asynEnumMask | asynDrvUserMask,
/* Interrupt mask */
asynInt32Mask | asynFloat64Mask | asynUInt32DigitalMask | asynOctetMask |
asynInt8ArrayMask | asynInt16ArrayMask | asynInt32ArrayMask | asynFloat32ArrayMask | asynFloat64ArrayMask |
asynEnumMask,
0, /* asynFlags. This driver does not block and it is not multi-device, so flag is 0 */
1, /* Autoconnect */
0, /* Default priority */
0) /* Default stack size*/
{
asynStatus status;
int i;
const char *functionName = "testErrors";
createParam(P_StatusReturnString, asynParamInt32, &P_StatusReturn);
createParam(P_EnumOrderString, asynParamInt32, &P_EnumOrder);
createParam(P_Int32ValueString, asynParamInt32, &P_Int32Value);
createParam(P_Float64ValueString, asynParamFloat64, &P_Float64Value);
createParam(P_UInt32DigitalValueString, asynParamUInt32Digital, &P_UInt32DigitalValue);
createParam(P_OctetValueString, asynParamOctet, &P_OctetValue);
createParam(P_Int8ArrayValueString, asynParamInt8Array, &P_Int8ArrayValue);
createParam(P_Int16ArrayValueString, asynParamInt16Array, &P_Int16ArrayValue);
createParam(P_Int32ArrayValueString, asynParamInt32Array, &P_Int32ArrayValue);
createParam(P_Float32ArrayValueString, asynParamFloat32Array, &P_Float32ArrayValue);
createParam(P_Float64ArrayValueString, asynParamFloat64Array, &P_Float64ArrayValue);
for (i=0; i<MAX_INT32_ENUMS; i++) {
int32EnumStrings_[i] = (char*)calloc(MAX_ENUM_STRING_SIZE, sizeof(char));
}
for (i=0; i<MAX_UINT32_ENUMS; i++) {
uint32EnumStrings_[i] = (char*)calloc(MAX_ENUM_STRING_SIZE, sizeof(char));
}
setIntegerParam(P_StatusReturn, asynSuccess);
setIntegerParam(P_Int32Value, 0);
setDoubleParam(P_Float64Value, 0.0);
setIntegerParam(P_EnumOrder, 0);
setEnums();
// Need to force callbacks with the interruptMask once
setUIntDigitalParam(P_UInt32DigitalValue, (epicsUInt32)0x0, 0xFFFFFFFF, 0xFFFFFFFF);
/* Create the thread that computes the waveforms in the background */
status = (asynStatus)(epicsThreadCreate("testErrorsTask",
epicsThreadPriorityMedium,
epicsThreadGetStackSize(epicsThreadStackMedium),
(EPICSTHREADFUNC)::callbackTask,
this) == NULL);
if (status) {
printf("%s:%s: epicsThreadCreate failure\n", driverName, functionName);
return;
}
}
开发者ID:ukaea,项目名称:epics,代码行数:61,代码来源:testErrors.cpp
示例20: createRfmHandler
int createRfmHandler (ST_STD_device *pSTDdev)
{
epicsThreadCreate ("rfm_recv",
epicsThreadPriorityHigh,
epicsThreadGetStackSize(epicsThreadStackMedium),
(EPICSTHREADFUNC) kstar_rfm_handler,
(void*)pSTDdev);
return WR_OK;
}
开发者ID:Sangil-Lee,项目名称:RefCode,代码行数:10,代码来源:drvEC1_ANT.c
注:本文中的epicsThreadCreate函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论