 +  {
 +    LOG_SYSFATAL << "Failed in socketpair";
 +  }
++  sockets::setNonBlockAndCloseOnExec(wakeupFd_[0]);
++  sockets::setNonBlockAndCloseOnExec(wakeupFd_[1]);
 +  wakeupChannel_.reset(new Channel(this, wakeupFd_[0]));
 +
    if (t_loopInThisThread)
    {
      LOG_FATAL << "Another EventLoop " << t_loopInThisThread
-@@ -93,7 +85,8 @@ EventLoop::~EventLoop()
+@@ -93,7 +87,8 @@ EventLoop::~EventLoop()
  {
    LOG_DEBUG << "EventLoop " << this << " of thread " << threadId_
              << " destructs in thread " << CurrentThread::tid();

   t_loopInThisThread = NULL;
 }
 
@@ -108,12 +101,13 @@ void EventLoop::loop()
   while (!quit_)
   {
     activeChannels_.clear();

   if (connfd < 0)
   {
     int savedErrno = errno;
diff --git a/muduo/net/SocketsOps.h b/muduo/net/SocketsOps.h
--- a/muduo/net/SocketsOps.h
+++ b/muduo/net/SocketsOps.h
@@ -25,6 +25,8 @@ namespace sockets
 /// abort if any error.
 int createNonblockingOrDie();
 
+void setNonBlockAndCloseOnExec(int sockfd);
+
 int  connect(int sockfd, const struct sockaddr_in& addr);
 void bindOrDie(int sockfd, const struct sockaddr_in& addr);
 void listenOrDie(int sockfd);
diff --git a/muduo/net/TimerQueue.cc b/muduo/net/TimerQueue.cc
--- a/muduo/net/TimerQueue.cc
+++ b/muduo/net/TimerQueue.cc
