fix for mantis 348
This commit is contained in:
@@ -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 ) {
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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 ();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user