fix for mantis 348

This commit is contained in:
Jeff Hill
2009-07-14 22:51:06 +00:00
parent d01e54bd34
commit 9e49e0131f
4 changed files with 17 additions and 6 deletions

View File

@@ -116,6 +116,13 @@ caStatus casStrmClient::processMsg ()
{
epicsGuard < casClientMutex > guard ( this->mutex );
int status = S_cas_success;
// protect against service returning s_casApp_success when it
// returned S_casApp_postponeAsyncIO before, but no
// asyn IO completed since the last attempt
if ( this->isBlocked () ) {
return S_casApp_postponeAsyncIO;
}
try {
@@ -457,7 +464,7 @@ caStatus casStrmClient::readAction ( epicsGuard < casClientMutex > & guard )
return this->sendErr ( guard, mp, pChan->getCID(),
status, "read access denied" );
}
const gdd * pDesc = 0;
status = this->read ( pDesc );
if ( status == S_casApp_success ) {

View File

@@ -36,6 +36,7 @@ friend class ioBlockedList;
public:
ioBlocked ();
virtual ~ioBlocked ();
bool isBlocked ();
private:
class ioBlockedList * pList;
virtual void ioBlockedSignal ();
@@ -52,5 +53,10 @@ public:
ioBlockedList & operator = ( const ioBlockedList & );
};
inline bool ioBlocked :: isBlocked ()
{
return this->pList != NULL;
}
#endif // ioBlockedh

View File

@@ -217,6 +217,7 @@ void casStreamIOWakeup::show ( unsigned level ) const
//
epicsTimerNotify::expireStatus casStreamIOWakeup::expire ( const epicsTime & /* currentTime */ )
{
assert ( this->pOS );
casStreamOS & tmpOS = *this->pOS;
this->pOS = 0;
tmpOS.processInput();

View File

@@ -69,9 +69,7 @@ ioBlockedList::ioBlockedList ()
//
ioBlockedList::~ioBlockedList ()
{
ioBlocked *pB;
while ( (pB = this->get ()) ) {
for ( ioBlocked * pB = this->get (); pB; pB = this->get () ) {
pB->pList = NULL;
}
}
@@ -86,14 +84,13 @@ ioBlockedList::~ioBlockedList ()
void ioBlockedList::signal ()
{
tsDLList<ioBlocked> tmp;
ioBlocked *pB;
//
// move all of the items onto tmp
//
tmp.add(*this);
while ( (pB = tmp.get ()) ) {
for ( ioBlocked * pB = tmp.get (); pB; pB = tmp.get () ) {
pB->pList = NULL;
pB->ioBlockedSignal ();
}