cleaned up implementation of locks

This commit is contained in:
Jeff Hill
2001-03-23 23:00:03 +00:00
parent 02c05f38b1
commit b1d14576c5
7 changed files with 119 additions and 146 deletions

View File

@@ -36,23 +36,23 @@ dbSubscriptionIO::dbSubscriptionIO ( dbChannelIO &chanIO,
cacNotifyIO ( notifyIn ), chan ( chanIO ), es ( 0 ),
type ( typeIn ), count ( countIn )
{
dbAutoScanLockCA locker ( this->chan );
this->chan.eventq.add ( *this );
}
dbSubscriptionIO::~dbSubscriptionIO ()
{
{
dbAutoScanLockCA locker ( this->chan );
this->chan.eventq.remove ( *this );
}
if ( this->es ) {
db_cancel_event ( this->es );
}
}
void dbSubscriptionIO::destroy ()
{
delete this;
}
void dbSubscriptionIO::cancel ()
{
this->chan.uninstallSubscription ( *this );
delete this;
}
@@ -77,7 +77,7 @@ extern "C" void dbSubscriptionEventCallback ( void *pPrivate, struct dbAddr * /*
int /* eventsRemaining */, struct db_field_log *pfl )
{
dbSubscriptionIO *pIO = static_cast < dbSubscriptionIO * > ( pPrivate );
pIO->chan.subscriptionUpdate ( pIO->type, pIO->count, pfl, *pIO );
pIO->chan.callReadNotify ( pIO->type, pIO->count, pfl, pIO->notify() );
}
int dbSubscriptionIO::begin ( unsigned mask )