changed interface so that callback is immediate if there is no space in the queue

This commit is contained in:
Jeff Hill
2002-06-27 23:54:01 +00:00
parent f124a5b941
commit 5aef71fe05
2 changed files with 11 additions and 10 deletions

View File

@@ -82,6 +82,7 @@ void ipAddrToAsciiEngine::run ()
{
epicsGuard < epicsMutex > locker ( ipAddrToAsciiEngine::mutex );
if ( this->pCurrent ) {
this->pCurrent->pEngine = 0;
this->callbackInProgress = true;
}
else {
@@ -94,10 +95,7 @@ void ipAddrToAsciiEngine::run ()
{
epicsGuard < epicsMutex > locker ( ipAddrToAsciiEngine::mutex );
if ( this->pCurrent ) {
this->pCurrent->pEngine = 0;
this->pCurrent = 0;
}
this->pCurrent = 0;
this->callbackInProgress = false;
}
if ( this->cancelPending ) {
@@ -173,7 +171,7 @@ ipAddrToAsciiAsynchronous::~ipAddrToAsciiAsynchronous ()
}
}
epicsShareFunc bool ipAddrToAsciiAsynchronous::ioInitiate ( ipAddrToAsciiEngine & engine )
epicsShareFunc void ipAddrToAsciiAsynchronous::ioInitiate ( ipAddrToAsciiEngine & engine )
{
bool success;
@@ -193,8 +191,12 @@ epicsShareFunc bool ipAddrToAsciiAsynchronous::ioInitiate ( ipAddrToAsciiEngine
if ( success ) {
engine.laborEvent.signal ();
}
return success;
else {
char autoNameTmp[256];
sockAddrToA ( &this->addr.sa, autoNameTmp,
sizeof ( autoNameTmp ) );
this->ioCompletionNotify ( autoNameTmp );
}
}
void ipAddrToAsciiAsynchronous::show ( unsigned level ) const

View File

@@ -56,15 +56,14 @@ private:
// - this class implements the asynchronous DNS query
// - it completes early with the host name in dotted IP address form
// if the ipAddrToAsciiEngine is destroyed before IO completion
// - ioInitiate fails if there are too many items already in
// the engine's queue.
// or if there are too many items already in the engine's queue.
//
class ipAddrToAsciiAsynchronous :
public tsDLNode < ipAddrToAsciiAsynchronous > {
public:
epicsShareFunc ipAddrToAsciiAsynchronous ( const osiSockAddr & addr );
epicsShareFunc virtual ~ipAddrToAsciiAsynchronous ();
epicsShareFunc bool ioInitiate ( ipAddrToAsciiEngine &engine );
epicsShareFunc void ioInitiate ( ipAddrToAsciiEngine & engine );
epicsShareFunc bool identicalAddress ( const osiSockAddr & addr ) const;
epicsShareFunc osiSockAddr address () const;
epicsShareFunc void show ( unsigned level ) const;