diff options
| author | Andrew Stitcher <astitcher@apache.org> | 2013-01-30 19:47:54 +0000 |
|---|---|---|
| committer | Andrew Stitcher <astitcher@apache.org> | 2013-01-30 19:47:54 +0000 |
| commit | 686d2cd2454c6f8c718731824613e43fd690bb0d (patch) | |
| tree | 81b7b051c608c673d33728fd92b45b8ffcda08a0 /cpp/src/qpid/sys/AsynchIOHandler.cpp | |
| parent | 9c6950b9bce6ef88bc5591cb0e3c9810a1c68f82 (diff) | |
| download | qpid-python-686d2cd2454c6f8c718731824613e43fd690bb0d.tar.gz | |
QPID-4514: Remove IO readCredit throttling only used by removed cluster code
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1440616 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/sys/AsynchIOHandler.cpp')
| -rw-r--r-- | cpp/src/qpid/sys/AsynchIOHandler.cpp | 38 |
1 files changed, 1 insertions, 37 deletions
diff --git a/cpp/src/qpid/sys/AsynchIOHandler.cpp b/cpp/src/qpid/sys/AsynchIOHandler.cpp index 0225b11d27..13c71e301b 100644 --- a/cpp/src/qpid/sys/AsynchIOHandler.cpp +++ b/cpp/src/qpid/sys/AsynchIOHandler.cpp @@ -59,8 +59,7 @@ AsynchIOHandler::AsynchIOHandler(const std::string& id, ConnectionCodec::Factory reads(0), readError(false), isClient(isClient0), - nodict(nodict0), - readCredit(InfiniteCredit) + nodict(nodict0) {} AsynchIOHandler::~AsynchIOHandler() { @@ -104,21 +103,6 @@ void AsynchIOHandler::activateOutput() { aio->notifyPendingWrite(); } -// Input side -void AsynchIOHandler::giveReadCredit(int32_t credit) { - // Check whether we started in the don't about credit state - if (readCredit.boolCompareAndSwap(InfiniteCredit, credit)) - 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); - if (readCredit.fetchAndAdd(credit) != 0) - return; - assert(readCredit.get() >= 0); - if (readCredit.get() != 0) - aio->startReading(); -} - namespace { SecuritySettings getSecuritySettings(AsynchIO* aio, bool nodict) { @@ -133,26 +117,6 @@ void AsynchIOHandler::readbuff(AsynchIO& , AsynchIO::BufferBase* buff) { return; } - // 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); - if (--readCredit == 0) { - assert(readCredit.get() >= 0); - if (readCredit.get() == 0) { - aio->stopReading(); - } - } - } - ++reads; size_t decoded = 0; if (codec) { // Already initiated |
