diff options
author | Andrew Stitcher <astitcher@apache.org> | 2010-06-23 04:52:49 +0000 |
---|---|---|
committer | Andrew Stitcher <astitcher@apache.org> | 2010-06-23 04:52:49 +0000 |
commit | 3032c367c035850987192c82dd2621bb9b0ac7f5 (patch) | |
tree | c61b0841953c867053fb47c7b690e031b7373e6b | |
parent | 91c77007649756868748b02fa8fd7ff9d6e881b4 (diff) | |
download | qpid-python-3032c367c035850987192c82dd2621bb9b0ac7f5.tar.gz |
QPID-2388: Do not unmask signals whilst waiting for IO to happen
- The client and common libraries do not use signals at all so
there is no real reason to allow signal handling on IO threads.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@957109 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | qpid/cpp/src/qpid/sys/epoll/EpollPoller.cpp | 12 | ||||
-rw-r--r-- | qpid/cpp/src/tests/DispatcherTest.cpp | 8 |
2 files changed, 2 insertions, 18 deletions
diff --git a/qpid/cpp/src/qpid/sys/epoll/EpollPoller.cpp b/qpid/cpp/src/qpid/sys/epoll/EpollPoller.cpp index 9ae9bcefb5..9ad05c71a3 100644 --- a/qpid/cpp/src/qpid/sys/epoll/EpollPoller.cpp +++ b/qpid/cpp/src/qpid/sys/epoll/EpollPoller.cpp @@ -262,7 +262,6 @@ class PollerPrivate { const int epollFd; bool isShutdown; InterruptHandle interruptHandle; - ::sigset_t sigMask; HandleSet registeredHandles; AtomicCount threadCount; @@ -294,7 +293,6 @@ class PollerPrivate { epollFd(::epoll_create(DefaultFds)), isShutdown(false) { QPID_POSIX_CHECK(epollFd); - ::sigemptyset(&sigMask); // Add always readable fd into our set (but not listening to it yet) ::epoll_event epe; epe.events = 0; @@ -562,17 +560,7 @@ Poller::Event Poller::wait(Duration timeout) { // Repeat until we weren't interrupted by signal do { PollerHandleDeletionManager.markAllUnusedInThisThread(); - // Need to run on kernels without epoll_pwait() - // - fortunately in this case we don't really need the atomicity of epoll_pwait() -#if 1 - sigset_t os; - pthread_sigmask(SIG_SETMASK, &impl->sigMask, &os); int rc = ::epoll_wait(impl->epollFd, &epe, 1, timeoutMs); - pthread_sigmask(SIG_SETMASK, &os, 0); -#else - int rc = ::epoll_pwait(impl->epollFd, &epe, 1, timeoutMs, &impl->sigMask); -#endif - if (rc ==-1 && errno != EINTR) { QPID_POSIX_CHECK(rc); } else if (rc > 0) { diff --git a/qpid/cpp/src/tests/DispatcherTest.cpp b/qpid/cpp/src/tests/DispatcherTest.cpp index 17b3b4e3e6..41e605499f 100644 --- a/qpid/cpp/src/tests/DispatcherTest.cpp +++ b/qpid/cpp/src/tests/DispatcherTest.cpp @@ -161,12 +161,8 @@ int main(int /*argc*/, char** /*argv*/) wh->startWatch(poller); // Set up a regular itimer interupt - - // Ignore signal in this thread - ::sigset_t sm; - ::sigemptyset(&sm); - ::sigaddset(&sm, SIGRTMIN); - ::pthread_sigmask(SIG_BLOCK, &sm, 0); + // We assume that this thread will handle the signals whilst sleeping + // as the Poller threads have signal handling blocked // Signal handling struct ::sigaction sa; |