diff options
author | Ted Ross <tross@apache.org> | 2010-01-13 11:57:19 +0000 |
---|---|---|
committer | Ted Ross <tross@apache.org> | 2010-01-13 11:57:19 +0000 |
commit | 79a29f32ef84c26de35d3e75c3acff314b727f56 (patch) | |
tree | d66d4d2a8a6cc2d9836fd1816b818a1c6e859e35 /cpp/src/qmf/engine/ResilientConnection.cpp | |
parent | ac53f58b4387bc54b186a9ac3a8933ecce77790e (diff) | |
download | qpid-python-79a29f32ef84c26de35d3e75c3acff314b727f56.tar.gz |
Added raise_event support to the Ruby and Python wrapped agent APIs.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@898727 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qmf/engine/ResilientConnection.cpp')
-rw-r--r-- | cpp/src/qmf/engine/ResilientConnection.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/cpp/src/qmf/engine/ResilientConnection.cpp b/cpp/src/qmf/engine/ResilientConnection.cpp index 53524fdbd8..9c19e4d460 100644 --- a/cpp/src/qmf/engine/ResilientConnection.cpp +++ b/cpp/src/qmf/engine/ResilientConnection.cpp @@ -39,6 +39,8 @@ #include <set> #include <boost/intrusive_ptr.hpp> #include <boost/noncopyable.hpp> +#include <unistd.h> +#include <fcntl.h> using namespace std; using namespace qmf::engine; @@ -330,6 +332,10 @@ void ResilientConnectionImpl::unbind(SessionHandle handle, void ResilientConnectionImpl::setNotifyFd(int fd) { notifyFd = fd; + if (notifyFd > 0) { + int original = fcntl(notifyFd, F_GETFL); + fcntl(notifyFd, F_SETFL, O_NONBLOCK | original); + } } void ResilientConnectionImpl::run() @@ -403,13 +409,16 @@ void ResilientConnectionImpl::EnqueueEvent(ResilientConnectionEvent::EventKind k const MessageImpl& message, const string& errorText) { - Mutex::ScopedLock _lock(lock); - ResilientConnectionEventImpl event(kind, message); + { + Mutex::ScopedLock _lock(lock); + ResilientConnectionEventImpl event(kind, message); - event.sessionContext = sessionContext; - event.errorText = errorText; + event.sessionContext = sessionContext; + event.errorText = errorText; + + eventQueue.push_back(event); + } - eventQueue.push_back(event); if (notifyFd != -1) { int unused_ret; //Suppress warnings about ignoring return value. |