get rid of threadGetName

This commit is contained in:
Marty Kraimer
2000-02-10 15:46:01 +00:00
parent ff7a40d68c
commit 89e5563437
5 changed files with 65 additions and 18 deletions
+2 -2
View File
@@ -56,8 +56,8 @@ SRCS += initHooks.c
SRCS += dbcar.c
LIBRARY = db
DLL_LIBS = Db Com
LIBRARY_IOC = db
DLL_LIBS = dbStaticIoc Com
include $(TOP)/configure/RULES
+59 -11
View File
@@ -21,6 +21,7 @@ of this distribution.
#include "osiSem.h"
#include "osiThread.h"
#include "osiInterrupt.h"
#include "osiTimer.h"
#include "osiRing.h"
#include "errlog.h"
#include "callback.h"
@@ -40,6 +41,16 @@ volatile int callbackRestart=FALSE;
static int priorityValue[NUM_CALLBACK_PRIORITIES] = {0,1,2};
/*for Delayed Requests */
static void expire(void *pPrivate);
static void destroy(void *pPrivate);
static int again(void *pPrivate);
static double delay(void *pPrivate);
static void show(void *pPrivate, unsigned level);
static osiTimerJumpTable jumpTable = { expire,destroy,again,delay,show};
static osiTimerQueueId timerQueue;
/* forward references */
static void wdCallback(void *ind); /*callback from taskwd*/
static void start(int ind); /*start or restart a callbackTask*/
@@ -55,6 +66,7 @@ long callbackInit()
{
int i;
timerQueue = osiTimerQueueCreate(threadPriorityScanLow);
for(i=0; i<NUM_CALLBACK_PRIORITIES; i++) {
start(i);
}
@@ -148,31 +160,67 @@ static void wdCallback(void *pind)
start(ind);
}
static void ProcessCallback(CALLBACK *pCallback)
static void ProcessCallback(CALLBACK *pcallback)
{
dbCommon *pRec;
callbackGetUser(pRec, pCallback);
callbackGetUser(pRec, pcallback);
dbScanLock(pRec);
(*pRec->rset->process)(pRec);
dbScanUnlock(pRec);
}
void callbackRequestProcessCallback(CALLBACK *pCallback,
void callbackRequestProcessCallback(CALLBACK *pcallback,
int Priority, void *pRec)
{
callbackSetCallback(ProcessCallback, pCallback);
callbackSetPriority(Priority, pCallback);
callbackSetUser(pRec, pCallback);
callbackRequest(pCallback);
callbackSetCallback(ProcessCallback, pcallback);
callbackSetPriority(Priority, pcallback);
callbackSetUser(pRec, pcallback);
callbackRequest(pcallback);
}
void callbackRequestDelayed(CALLBACK *pCallback,double seconds)
void expire(void *pPrivate)
{
printf("callbackRequestDelayed not yet implemented\n");
CALLBACK *pcallback = (CALLBACK *)pPrivate;
callbackRequest(pcallback);
}
void callbackRequestProcessCallbackDelayed(CALLBACK *pCallback,
void destroy(void *pPrivate)
{
return;
}
int again(void *pPrivate)
{
return(0);
}
double delay(void *pPrivate)
{
return(0.0);
}
void show(void *pPrivate, unsigned level)
{
return;
}
void callbackRequestDelayed(CALLBACK *pcallback,double seconds)
{
osiTimerId timer = (osiTimerId *)pcallback->timer;
if(timer==0) {
timer = osiTimerCreate(&jumpTable,(void *)pcallback);
pcallback->timer = timer;
}
osiTimerArm(timer,timerQueue,seconds);
}
void callbackRequestProcessCallbackDelayed(CALLBACK *pcallback,
int Priority, void *pRec,double seconds)
{
printf("callbackRequestDelayed not yet implemented\n");
callbackSetCallback(ProcessCallback, pcallback);
callbackSetPriority(Priority, pcallback);
callbackSetUser(pRec, pcallback);
callbackRequestDelayed(pcallback,seconds);
}
+1
View File
@@ -46,6 +46,7 @@ typedef struct callbackPvt {
#endif
int priority;
void *user; /*for use by callback user*/
void *timer; /*for use by callback itself*/
}CALLBACK;
#ifdef __STDC__
+2 -2
View File
@@ -315,10 +315,10 @@ void recGblGetTimeStamp(void* prec)
if(pr->tsel.type!=CONSTANT)
{
dbGetLink(&(pr->tsel), DBR_SHORT,&(pr->tse),0,0);
status = tsStampGetEvent((int)pr->tse,&pr->time);
status = tsStampGetEvent(&pr->time,(unsigned)pr->tse);
}
else
status = tsStampGetEvent((int)pr->tse,&pr->time);
status = tsStampGetEvent(&pr->time,(unsigned)pr->tse);
if(status) errlogPrintf("%s recGblGetTimeStamp failed\n",pr->name);
}
+1 -3
View File
@@ -165,15 +165,13 @@ static void taskwdTask(void)
while(pt) {
next = (struct task_list *)ellNext((void *)pt);
if(threadIsSuspended(pt->id.tid)) {
const char *pname;
char message[100];
pname = threadGetName(pt->id.tid);
if(!pt->suspended) {
struct task_list *ptany;
pt->suspended = TRUE;
sprintf(message,"task %s suspended",pname);
sprintf(message,"task %p suspended",pt->id.tid);
errMessage(-1,message);
ptany = (struct task_list *)ellFirst(&anylist);
while(ptany) {