summaryrefslogtreecommitdiff
path: root/qpid/wcf/src/Apache/Qpid/Interop/AmqpSession.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qpid/wcf/src/Apache/Qpid/Interop/AmqpSession.cpp')
-rw-r--r--qpid/wcf/src/Apache/Qpid/Interop/AmqpSession.cpp29
1 files changed, 25 insertions, 4 deletions
diff --git a/qpid/wcf/src/Apache/Qpid/Interop/AmqpSession.cpp b/qpid/wcf/src/Apache/Qpid/Interop/AmqpSession.cpp
index d2adb41205..ac7c777d1f 100644
--- a/qpid/wcf/src/Apache/Qpid/Interop/AmqpSession.cpp
+++ b/qpid/wcf/src/Apache/Qpid/Interop/AmqpSession.cpp
@@ -357,17 +357,20 @@ bool AmqpSession::MessageStop(std::string &name)
return true;
}
-void AmqpSession::AcceptAndComplete(SequenceSet& transfers)
+void AmqpSession::AcceptAndComplete(SequenceSet& transfers, bool browsing)
{
lock l(sessionLock);
- // delimit with session dtx commands depending on the transaction context
- UpdateTransactionState(%l);
+ if (!browsing) {
+ // delimit with session dtx commands depending on the transaction context
+ UpdateTransactionState(%l);
+ }
CheckOpen();
sessionp->markCompleted(transfers, false);
- sessionp->messageAccept(transfers, false);
+ if (!browsing)
+ sessionp->messageAccept(transfers, false);
}
@@ -609,4 +612,22 @@ void AmqpSession::ReleaseCompletion(IntPtr completion) {
delete completion.ToPointer();
}
+
+// Non-exclusive borrowing for a "brief" period. I.e. several synced
+// commands (address resolution)
+
+IntPtr AmqpSession::BorrowNativeSession() {
+ lock l(sessionLock);
+ if (closing)
+ return IntPtr::Zero;
+
+ IncrementSyncs();
+ return (IntPtr) sessionp;
+}
+
+void AmqpSession::ReturnNativeSession() {
+ lock l(sessionLock);
+ DecrementSyncs();
+}
+
}}} // namespace Apache::Qpid::Cli