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 2012/08/02 22:17:04 UTC
svn commit: r1368685 -
/qpid/trunk/qpid/cpp/src/qpid/sys/epoll/EpollPoller.cpp
Author: astitcher
Date: Thu Aug 2 20:17:03 2012
New Revision: 1368685
URL: http://svn.apache.org/viewvc?rev=1368685&view=rev
Log:
Remove static initialisation from EpollPoller
- It's better practice in a library not to rely on any globals
or static initialisation.
- This should also fix QPID-2367
Modified:
qpid/trunk/qpid/cpp/src/qpid/sys/epoll/EpollPoller.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=1368685&r1=1368684&r2=1368685&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/sys/epoll/EpollPoller.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/sys/epoll/EpollPoller.cpp Thu Aug 2 20:17:03 2012
@@ -221,8 +221,8 @@ class PollerPrivate {
}
};
- static ReadablePipe alwaysReadable;
- static int alwaysReadableFd;
+ ReadablePipe alwaysReadable;
+ int alwaysReadableFd;
class InterruptHandle: public PollerHandle {
std::queue<PollerHandle*> handles;
@@ -290,6 +290,7 @@ class PollerPrivate {
}
PollerPrivate() :
+ alwaysReadableFd(alwaysReadable.getFD()),
epollFd(::epoll_create(DefaultFds)),
isShutdown(false) {
QPID_POSIX_CHECK(epollFd);
@@ -328,9 +329,6 @@ class PollerPrivate {
}
};
-PollerPrivate::ReadablePipe PollerPrivate::alwaysReadable;
-int PollerPrivate::alwaysReadableFd = alwaysReadable.getFD();
-
void Poller::registerHandle(PollerHandle& handle) {
PollerHandlePrivate& eh = *handle.impl;
ScopedLock<Mutex> l(eh.lock);
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org