more fixes for use of defunct task var under vxWorks

This commit is contained in:
Jeff Hill
1994-11-17 21:12:23 +00:00
parent 1c7a4ef3db
commit bc89526dff
4 changed files with 43 additions and 27 deletions

View File

@@ -517,10 +517,12 @@ int APIENTRY ca_task_initialize(void)
ellInit(&ca_static->ca_pend_write_list);
ellInit(&ca_static->putCvrtBuf);
ca_static->ca_pSlowBucket = bucketCreate(CLIENT_HASH_TBL_SIZE);
ca_static->ca_pSlowBucket =
bucketCreate(CLIENT_HASH_TBL_SIZE);
assert(ca_static->ca_pSlowBucket);
ca_static->ca_pFastBucket = bucketCreate(CLIENT_HASH_TBL_SIZE);
ca_static->ca_pFastBucket =
bucketCreate(CLIENT_HASH_TBL_SIZE);
assert(ca_static->ca_pFastBucket);
status = cac_os_depen_init(ca_static);
@@ -797,7 +799,7 @@ void ca_process_exit(struct ca_static *ca_temp)
monix = (evid) ellFirst(&ca_temp->ca_pend_read_list);
while (monix) {
monixNext = (evid) ellNext (&monix->node);
caIOBlockFree (monix);
caIOBlockFree (ca_temp, monix);
monix = monixNext;
}
@@ -805,7 +807,7 @@ void ca_process_exit(struct ca_static *ca_temp)
monix = (evid) ellFirst(&ca_temp->ca_pend_write_list);
while (monix) {
monixNext = (evid) ellNext (&monix->node);
caIOBlockFree (monix);
caIOBlockFree (ca_temp, monix);
monix = monixNext;
}
@@ -1288,12 +1290,14 @@ LOCAL evid caIOBlockCreate(void)
/*
* caIOBlockFree()
*/
void caIOBlockFree(evid pIOBlock)
void caIOBlockFree(struct ca_static *pCAC, evid pIOBlock)
{
int status;
LOCK;
status = bucketRemoveItemUnsignedId(pFastBucket, &pIOBlock->id);
status = bucketRemoveItemUnsignedId(
pCAC->ca_pFastBucket,
&pIOBlock->id);
assert (status == BUCKET_SUCCESS);
pIOBlock->id = ~0U; /* this id always invalid */
ellAdd (&free_event_list, &pIOBlock->node);
@@ -1490,7 +1494,7 @@ void *usrarg
pvalue);
if(status != ECA_NORMAL){
if(chix->piiu){
caIOBlockFree(monix);
caIOBlockFree(ca_static, monix);
}
return status;
}
@@ -2506,7 +2510,7 @@ void clearChannelResources(struct ca_static *pCAC, unsigned id)
* remove any orphaned get callbacks for this
* channel
*/
for (monix = (evid) ellFirst (&pCAC->ca_pend_read_list.node);
for (monix = (evid) ellFirst (&pCAC->ca_pend_read_list);
monix;
monix = next) {
next = (evid) ellNext (&monix->node);
@@ -2514,7 +2518,7 @@ void clearChannelResources(struct ca_static *pCAC, unsigned id)
ellDelete (
&pCAC->ca_pend_read_list,
&monix->node);
caIOBlockFree (monix);
caIOBlockFree (pCAC, monix);
}
}
for (monix = (evid) ellFirst (&chix->eventq);
@@ -2522,16 +2526,18 @@ void clearChannelResources(struct ca_static *pCAC, unsigned id)
monix = next){
assert (monix->chan == chix);
next = (evid) ellNext (&monix->node);
caIOBlockFree(monix);
caIOBlockFree(pCAC, monix);
}
ellDelete(&piiu->chidlist, &chix->node);
status = bucketRemoveItemUnsignedId(
ellDelete (&piiu->chidlist, &chix->node);
status = bucketRemoveItemUnsignedId (
pCAC->ca_pSlowBucket, &chix->cid);
assert (status == BUCKET_SUCCESS);
free(chix);
free (chix);
if (!piiu->chidlist.count){
TAG_CONN_DOWN(piiu);
}
UNLOCK;
}

View File

@@ -568,7 +568,7 @@ void cac_gettimeval(struct timeval *pt);
ca_real cac_time_diff(ca_time *pTVA, ca_time *pTVB);
/* returns A + B in integer secs & integer usec */
ca_time cac_time_sum(ca_time *pTVA, ca_time *pTVB);
void caIOBlockFree(evid pIOBlock);
void caIOBlockFree(struct ca_static *pCAC, evid pIOBlock);
void clearChannelResources(struct ca_static *pCAC, unsigned id);
/*

View File

@@ -285,7 +285,7 @@ struct in_addr *pnet_addr
ellDelete(&pend_write_list, &monix->node);
UNLOCK;
caIOBlockFree(monix);
caIOBlockFree(ca_static, monix);
break;
@@ -357,7 +357,7 @@ struct in_addr *pnet_addr
LOCK;
ellDelete(&pend_read_list, &monix->node);
UNLOCK;
caIOBlockFree(monix);
caIOBlockFree(ca_static, monix);
break;
}
@@ -389,7 +389,7 @@ struct in_addr *pnet_addr
LOCK;
ellDelete(&monix->chan->eventq, &monix->node);
UNLOCK;
caIOBlockFree(monix);
caIOBlockFree(ca_static, monix);
break;
}
@@ -493,7 +493,7 @@ struct in_addr *pnet_addr
LOCK;
ellDelete(&pend_read_list, &pIOBlock->node);
UNLOCK;
caIOBlockFree(pIOBlock);
caIOBlockFree(ca_static, pIOBlock);
break;
}
case IOC_SEARCH:
@@ -623,7 +623,7 @@ struct in_addr *pnet_addr
}
if (monix) {
caIOBlockFree(monix);
caIOBlockFree(ca_static, monix);
}
LOCK;

View File

@@ -283,7 +283,6 @@ LOCAL void ca_task_exit_tcb(WIND_TCB *ptcb)
ca_printf("CAC: entering the exit handler %x\n", ptcb);
# endif
/*
* NOTE: vxWorks provides no method at this time
* to get the task id from the ptcb so I am
@@ -291,14 +290,31 @@ LOCAL void ca_task_exit_tcb(WIND_TCB *ptcb)
* the task id - somthing which may not be true
* on future releases of vxWorks
*/
ca_temp = (struct ca_static *)taskVarGet((int)ptcb, (int *) &ca_static);
ca_temp = (struct ca_static *)
taskVarGet((int)ptcb, (int *) &ca_static);
if (ca_temp == (struct ca_static *) ERROR){
return;
}
/*
* vxWorks specific shut down
*/
cac_os_depen_exit(ca_temp, (int) ptcb);
/*
* normal CA sut down
*/
ca_process_exit(ca_temp);
/*
* remove semaphores here so that ca_process_exit()
* can use them.
*/
assert(semDelete(ca_temp->ca_client_lock)==OK);
assert(semDelete(ca_temp->ca_event_lock)==OK);
assert(semDelete(ca_temp->ca_putNotifyLock)==OK);
assert(semDelete(ca_temp->ca_io_done_sem)==OK);
assert(semDelete(ca_temp->ca_blockSem)==OK);
}
@@ -443,12 +459,6 @@ LOCAL int cac_os_depen_exit(struct ca_static *pcas, int tid)
ellFree(&pcas->ca_local_chidlist);
ellFree(&pcas->ca_dbfree_ev_list);
assert(semDelete(pcas->ca_client_lock)==OK);
assert(semDelete(pcas->ca_event_lock)==OK);
assert(semDelete(pcas->ca_putNotifyLock)==OK);
assert(semDelete(pcas->ca_io_done_sem)==OK);
assert(semDelete(pcas->ca_blockSem)==OK);
return ECA_NORMAL;
}