improved management of per channel IO list

This commit is contained in:
Jeff Hill
2000-09-15 17:32:24 +00:00
parent 83c72bce7a
commit db52f124b9
7 changed files with 64 additions and 21 deletions

View File

@@ -13,19 +13,34 @@
#include "iocinf.h"
#include "nciu_IL.h"
baseNMIU::baseNMIU ( nciu &chanIn ) : chan ( chanIn )
osiMutex baseNMIU::mutex;
baseNMIU::baseNMIU ( nciu &chanIn ) :
chan ( chanIn ), attachedToChannel ( true )
{
chanIn.ioInstall ( *this );
}
baseNMIU::~baseNMIU ()
{
// private NOOP forces pool allocation
this->uninstallFromChannel ();
}
void baseNMIU::uninstallFromChannel ()
{
this->mutex.lock ();
bool attached = this->attachedToChannel;
this->attachedToChannel = false;
this->mutex.unlock ();
if ( attached ) {
this->chan.ioUninstall ( *this );
}
}
void baseNMIU::destroy ()
{
this->chan.ioDestroy ( this->getId () );
delete this;
}
int baseNMIU::subscriptionMsg ()
@@ -35,5 +50,6 @@ int baseNMIU::subscriptionMsg ()
void baseNMIU::show ( unsigned /* level */ ) const
{
printf ( "CA IO primitive at %p for channel %s\n", this, chan.pName () );
printf ( "CA IO primitive at %p for channel %s\n",
this, this->chan.pName () );
}