fixed race condition

This commit is contained in:
Jeff Hill
2001-09-25 00:13:20 +00:00
parent 0768bb9764
commit c7a82c3ce2
2 changed files with 12 additions and 13 deletions

View File

@@ -173,7 +173,7 @@ void dbServiceIO::callStateNotify ( struct dbAddr & addr,
if ( status ) {
notify.exception ( ECA_GETFAIL,
"db_get_field() completed unsuccessfuly",
type, count);
type, count );
}
else {
notify.current ( type, count, this->pEventCallbackCache );
@@ -186,8 +186,8 @@ extern "C" void cacAttachClientCtx ( void * pPrivate )
assert ( status == ECA_NORMAL );
}
dbEventSubscription dbServiceIO::subscribe ( struct dbAddr &addr, dbChannelIO &chan,
dbSubscriptionIO &subscr, unsigned mask, cacChannel::ioid *pId )
dbEventSubscription dbServiceIO::subscribe ( struct dbAddr & addr, dbChannelIO & chan,
dbSubscriptionIO & subscr, unsigned mask )
{
dbEventSubscription es;
int status;
@@ -220,19 +220,12 @@ dbEventSubscription dbServiceIO::subscribe ( struct dbAddr &addr, dbChannelIO &c
es = db_add_event ( this->ctx, &addr,
dbSubscriptionEventCallback, (void *) &subscr, mask );
if ( es ) {
db_post_single_event ( es );
}
else {
if ( ! es ) {
epicsAutoMutex locker ( this->mutex );
chan.dbServicePrivateListOfIO::eventq.remove ( subscr );
this->ioTable.remove ( subscr );
}
if ( pId ) {
*pId = subscr.getId ();
}
return es;
}