diff options
author | Alan Conway <aconway@apache.org> | 2009-10-01 16:55:58 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2009-10-01 16:55:58 +0000 |
commit | 054546a9f7dda8e6877550c46eb258c623e67de6 (patch) | |
tree | 9cb54e090ad84f588d0d811f7df689dbbff8bc61 /cpp/src/qpid/sys/AsynchIOHandler.cpp | |
parent | a27debd4d1711ecdb9980419325f0707bb13c3f7 (diff) | |
download | qpid-python-054546a9f7dda8e6877550c46eb258c623e67de6.tar.gz |
Fix QPID-2086 - problem with read-credit.
Also cleaned up the cluster test scripts.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@820717 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/sys/AsynchIOHandler.cpp')
-rw-r--r-- | cpp/src/qpid/sys/AsynchIOHandler.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/cpp/src/qpid/sys/AsynchIOHandler.cpp b/cpp/src/qpid/sys/AsynchIOHandler.cpp index ae41eacfc3..eb0f213547 100644 --- a/cpp/src/qpid/sys/AsynchIOHandler.cpp +++ b/cpp/src/qpid/sys/AsynchIOHandler.cpp @@ -110,6 +110,13 @@ void AsynchIOHandler::readbuff(AsynchIO& , AsynchIO::BufferBase* buff) { // Check here for read credit if (readCredit.get() != InfiniteCredit) { + if (readCredit.get() == 0) { + // FIXME aconway 2009-10-01: Workaround to avoid "false wakeups". + // readbuff is sometimes called with no credit. + // This should be fixed somewhere else to avoid such calls. + aio->unread(buff); + return; + } // TODO In theory should be able to use an atomic operation before taking the lock // but in practice there seems to be an unexplained race in that case ScopedLock<Mutex> l(creditLock); |