qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From astitc...@apache.org
Subject svn commit: r1440617 - in /qpid/trunk/qpid/cpp/src/qpid/sys: AsynchIO.h posix/AsynchIO.cpp windows/AsynchIO.cpp windows/SslAsynchIO.cpp windows/SslAsynchIO.h
Date Wed, 30 Jan 2013 19:48:01 GMT
Author: astitcher
Date: Wed Jan 30 19:48:00 2013
New Revision: 1440617

URL: http://svn.apache.org/viewvc?rev=1440617&view=rev
Log:
QPID-4514: Remove IO start/stop reading primitives used by removed cluster

Modified:
    qpid/trunk/qpid/cpp/src/qpid/sys/AsynchIO.h
    qpid/trunk/qpid/cpp/src/qpid/sys/posix/AsynchIO.cpp
    qpid/trunk/qpid/cpp/src/qpid/sys/windows/AsynchIO.cpp
    qpid/trunk/qpid/cpp/src/qpid/sys/windows/SslAsynchIO.cpp
    qpid/trunk/qpid/cpp/src/qpid/sys/windows/SslAsynchIO.h

Modified: qpid/trunk/qpid/cpp/src/qpid/sys/AsynchIO.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/sys/AsynchIO.h?rev=1440617&r1=1440616&r2=1440617&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/sys/AsynchIO.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/sys/AsynchIO.h Wed Jan 30 19:48:00 2013
@@ -159,8 +159,6 @@ public:
     virtual void notifyPendingWrite() = 0;
     virtual void queueWriteClose() = 0;
     virtual bool writeQueueEmpty() = 0;
-    virtual void startReading() = 0;
-    virtual void stopReading() = 0;
     virtual void requestCallback(RequestCallback) = 0;
     virtual BufferBase* getQueuedBuffer() = 0;
 

Modified: qpid/trunk/qpid/cpp/src/qpid/sys/posix/AsynchIO.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/sys/posix/AsynchIO.cpp?rev=1440617&r1=1440616&r2=1440617&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/sys/posix/AsynchIO.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/sys/posix/AsynchIO.cpp Wed Jan 30 19:48:00 2013
@@ -268,8 +268,6 @@ public:
     virtual void notifyPendingWrite();
     virtual void queueWriteClose();
     virtual bool writeQueueEmpty();
-    virtual void startReading();
-    virtual void stopReading();
     virtual void requestCallback(RequestCallback);
     virtual BufferBase* getQueuedBuffer();
     virtual SecuritySettings getSecuritySettings();
@@ -304,13 +302,6 @@ private:
      * thread processing this handle.
      */
     volatile bool writePending;
-    /**
-     * This records whether we've been reading is flow controlled:
-     * it's safe as a simple boolean as the only way to be stopped
-     * is in calls only allowed in the callback context, the only calls
-     * checking it are also in calls only allowed in callback context.
-     */
-    volatile bool readingStopped;
 };
 
 AsynchIO::AsynchIO(const Socket& s,
@@ -329,8 +320,7 @@ AsynchIO::AsynchIO(const Socket& s,
     idleCallback(iCb),
     socket(s),
     queuedClose(false),
-    writePending(false),
-    readingStopped(false) {
+    writePending(false) {
 
     s.setNonblocking();
 }
@@ -366,7 +356,7 @@ void AsynchIO::queueReadBuffer(BufferBas
 
     bool queueWasEmpty = bufferQueue.empty();
     bufferQueue.push_back(buff);
-    if (queueWasEmpty && !readingStopped)
+    if (queueWasEmpty)
         DispatchHandle::rewatchRead();
 }
 
@@ -376,7 +366,7 @@ void AsynchIO::unread(BufferBase* buff) 
 
     bool queueWasEmpty = bufferQueue.empty();
     bufferQueue.push_front(buff);
-    if (queueWasEmpty && !readingStopped)
+    if (queueWasEmpty)
         DispatchHandle::rewatchRead();
 }
 
@@ -408,17 +398,6 @@ bool AsynchIO::writeQueueEmpty() {
     return writeQueue.empty();
 }
 
-// This can happen outside the callback context
-void AsynchIO::startReading() {
-    readingStopped = false;
-    DispatchHandle::rewatchRead();
-}
-
-void AsynchIO::stopReading() {
-    readingStopped = true;
-    DispatchHandle::unwatchRead();
-}
-
 void AsynchIO::requestCallback(RequestCallback callback) {
     // TODO creating a function object every time isn't all that
     // efficient - if this becomes heavily used do something better (what?)
@@ -451,11 +430,6 @@ AsynchIO::BufferBase* AsynchIO::getQueue
  * to put it in and reading is not stopped by flow control.
  */
 void AsynchIO::readable(DispatchHandle& h) {
-    if (readingStopped) {
-        // We have been flow controlled.
-        QPID_PROBE1(asynchio_read_flowcontrolled, &h);
-        return;
-    }
     AbsTime readStartTime = AbsTime::now();
     size_t total = 0;
     int readCalls = 0;
@@ -477,12 +451,6 @@ void AsynchIO::readable(DispatchHandle& 
                 total += rc;
 
                 readCallback(*this, buff);
-                if (readingStopped) {
-                    // We have been flow controlled.
-                    QPID_PROBE4(asynchio_read_finished_flowcontrolled, &h, duration,
total, readCalls);
-                    break;
-                }
-
                 if (rc != readCount) {
                     // If we didn't fill the read buffer then time to stop reading
                     QPID_PROBE4(asynchio_read_finished_done, &h, duration, total, readCalls);

Modified: qpid/trunk/qpid/cpp/src/qpid/sys/windows/AsynchIO.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/sys/windows/AsynchIO.cpp?rev=1440617&r1=1440616&r2=1440617&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/sys/windows/AsynchIO.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/sys/windows/AsynchIO.cpp Wed Jan 30 19:48:00 2013
@@ -286,8 +286,6 @@ public:
     virtual void notifyPendingWrite();
     virtual void queueWriteClose();
     virtual bool writeQueueEmpty();
-    virtual void startReading();
-    virtual void stopReading();
     virtual void requestCallback(RequestCallback);
 
     /**
@@ -347,6 +345,12 @@ private:
     void close(void);
 
     /**
+     * startReading initiates reading, readComplete() is
+     * called when the read completes.
+     */
+    void startReading();
+
+    /**
      * readComplete is called when a read request is complete.
      *
      * @param result Results of the operation.
@@ -565,15 +569,6 @@ void AsynchIO::startReading() {
     return;
 }
 
-// stopReading was added to prevent a race condition with read-credit on Linux.
-// It may or may not be required on windows.
-// 
-// AsynchIOHandler::readbuff() calls stopReading() inside the same
-// critical section that protects startReading() in
-// AsynchIOHandler::giveReadCredit().
-// 
-void AsynchIO::stopReading() {}
-
 // Queue the specified callback for invocation from an I/O thread.
 void AsynchIO::requestCallback(RequestCallback callback) {
     // This method is generally called from a processing thread; transfer

Modified: qpid/trunk/qpid/cpp/src/qpid/sys/windows/SslAsynchIO.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/sys/windows/SslAsynchIO.cpp?rev=1440617&r1=1440616&r2=1440617&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/sys/windows/SslAsynchIO.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/sys/windows/SslAsynchIO.cpp Wed Jan 30 19:48:00 2013
@@ -209,18 +209,6 @@ bool SslAsynchIO::writeQueueEmpty() {
     return aio->writeQueueEmpty();
 }
 
-/*
- * Initiate a read operation. AsynchIO::readComplete() will be
- * called when the read is complete and data is available.
- */
-void SslAsynchIO::startReading() {
-    aio->startReading();
-}
-
-void SslAsynchIO::stopReading() {
-    aio->stopReading();
-}
-
 // Queue the specified callback for invocation from an I/O thread.
 void SslAsynchIO::requestCallback(RequestCallback callback) {
     aio->requestCallback(callback);

Modified: qpid/trunk/qpid/cpp/src/qpid/sys/windows/SslAsynchIO.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/sys/windows/SslAsynchIO.h?rev=1440617&r1=1440616&r2=1440617&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/sys/windows/SslAsynchIO.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/sys/windows/SslAsynchIO.h Wed Jan 30 19:48:00 2013
@@ -77,8 +77,6 @@ public:
     virtual void notifyPendingWrite();
     virtual void queueWriteClose();
     virtual bool writeQueueEmpty();
-    virtual void startReading();
-    virtual void stopReading();
     virtual void requestCallback(RequestCallback);
     virtual BufferBase* getQueuedBuffer();
     virtual SecuritySettings getSecuritySettings(void);



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message