You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by as...@apache.org on 2010/06/23 06:52:49 UTC

svn commit: r957109 - in /qpid/trunk/qpid/cpp/src: qpid/sys/epoll/EpollPoller.cpp tests/DispatcherTest.cpp

Author: astitcher
Date: Wed Jun 23 04:52:49 2010
New Revision: 957109

URL: http://svn.apache.org/viewvc?rev=957109&view=rev
Log:
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.

Modified:
    qpid/trunk/qpid/cpp/src/qpid/sys/epoll/EpollPoller.cpp
    qpid/trunk/qpid/cpp/src/tests/DispatcherTest.cpp

Modified: qpid/trunk/qpid/cpp/src/qpid/sys/epoll/EpollPoller.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/sys/epoll/EpollPoller.cpp?rev=957109&r1=957108&r2=957109&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/sys/epoll/EpollPoller.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/sys/epoll/EpollPoller.cpp Wed Jun 23 04:52:49 2010
@@ -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 time
     // 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) {

Modified: qpid/trunk/qpid/cpp/src/tests/DispatcherTest.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/DispatcherTest.cpp?rev=957109&r1=957108&r2=957109&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/DispatcherTest.cpp (original)
+++ qpid/trunk/qpid/cpp/src/tests/DispatcherTest.cpp Wed Jun 23 04:52:49 2010
@@ -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;



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