Return-Path: Delivered-To: apmail-qpid-commits-archive@www.apache.org Received: (qmail 52831 invoked from network); 14 Jun 2010 14:51:29 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 14 Jun 2010 14:51:29 -0000 Received: (qmail 17357 invoked by uid 500); 14 Jun 2010 14:51:29 -0000 Delivered-To: apmail-qpid-commits-archive@qpid.apache.org Received: (qmail 17340 invoked by uid 500); 14 Jun 2010 14:51:29 -0000 Mailing-List: contact commits-help@qpid.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@qpid.apache.org Delivered-To: mailing list commits@qpid.apache.org Received: (qmail 17333 invoked by uid 99); 14 Jun 2010 14:51:29 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Jun 2010 14:51:29 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Jun 2010 14:51:27 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id EC0E923889EA; Mon, 14 Jun 2010 14:50:40 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@qpid.apache.org From: astitcher@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100614145040.EC0E923889EA@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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 FullCallback; typedef boost::function1 NotifyCallback; - QueuePair::intrusive_ptr qp; - qpid::sys::DispatchHandleRef dataHandle; int bufferSize; int recvCredit; int xmitCredit; @@ -62,6 +60,10 @@ namespace Rdma { std::deque bufferQueue; qpid::sys::Mutex bufferQueueLock; boost::ptr_deque 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