qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From astitc...@apache.org
Subject svn commit: r954498 - in /qpid/trunk/qpid/cpp/src/qpid/sys/rdma: RdmaIO.cpp RdmaIO.h
Date Mon, 14 Jun 2010 14:50:40 GMT
Author: astitcher
Date: Mon Jun 14 14:50:40 2010
New Revision: 954498

URL: http://svn.apache.org/viewvc?rev=954498&view=rev
Log:
Move QueuePair member in Rdma::AsynchIO to ensure that it get destroyed before
the buffers it uses, so that there is no hardware activity using them after
they are deleted

Modified:
    qpid/trunk/qpid/cpp/src/qpid/sys/rdma/RdmaIO.cpp
    qpid/trunk/qpid/cpp/src/qpid/sys/rdma/RdmaIO.h

Modified: qpid/trunk/qpid/cpp/src/qpid/sys/rdma/RdmaIO.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/sys/rdma/RdmaIO.cpp?rev=954498&r1=954497&r2=954498&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/sys/rdma/RdmaIO.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/sys/rdma/RdmaIO.cpp Mon Jun 14 14:50:40 2010
@@ -41,8 +41,6 @@ namespace Rdma {
             FullCallback fc,
             ErrorCallback ec
     ) :
-        qp(q),
-        dataHandle(*qp, boost::bind(&AsynchIO::dataEvent, this), 0, 0),
         bufferSize(size),
         recvCredit(0),
         xmitCredit(xCredit),
@@ -51,6 +49,8 @@ namespace Rdma {
         outstandingWrites(0),
         draining(false),
         state(IDLE),
+        qp(q),
+        dataHandle(*qp, boost::bind(&AsynchIO::dataEvent, this), 0, 0),
         readCallback(rc),
         idleCallback(ic),
         fullCallback(fc),

Modified: qpid/trunk/qpid/cpp/src/qpid/sys/rdma/RdmaIO.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/sys/rdma/RdmaIO.h?rev=954498&r1=954497&r2=954498&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/sys/rdma/RdmaIO.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/sys/rdma/RdmaIO.h Mon Jun 14 14:50:40 2010
@@ -47,8 +47,6 @@ namespace Rdma {
         typedef boost::function2<void, AsynchIO&, Buffer*> FullCallback;
         typedef boost::function1<void, AsynchIO&> NotifyCallback;
 
-        QueuePair::intrusive_ptr qp;
-        qpid::sys::DispatchHandleRef dataHandle;
         int bufferSize;
         int recvCredit;
         int xmitCredit;
@@ -62,6 +60,10 @@ namespace Rdma {
         std::deque<Buffer*> bufferQueue;
         qpid::sys::Mutex bufferQueueLock;
         boost::ptr_deque<Buffer> buffers;
+        // The QueuePair must be after the buffers so that the connection is destroyed before
the buffers
+        // are deallocated so that the hardware doesn't write into memory that's been given
back.
+        QueuePair::intrusive_ptr qp;
+        qpid::sys::DispatchHandleRef dataHandle;
 
         ReadCallback readCallback;
         IdleCallback idleCallback;



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org


Mime
View raw message