summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Stitcher <astitcher@apache.org>2012-08-02 20:17:03 +0000
committerAndrew Stitcher <astitcher@apache.org>2012-08-02 20:17:03 +0000
commit9746c538cdb3d3f91f30a0c35c74b124b1510bc1 (patch)
tree82a589d6803c31111fa41f8a31180db062a3d677
parentd883e3a66f524a810e536568f5e6795a7a44e2c1 (diff)
downloadqpid-python-9746c538cdb3d3f91f30a0c35c74b124b1510bc1.tar.gz
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 git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1368685 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--qpid/cpp/src/qpid/sys/epoll/EpollPoller.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/qpid/cpp/src/qpid/sys/epoll/EpollPoller.cpp b/qpid/cpp/src/qpid/sys/epoll/EpollPoller.cpp
index dcc9d9181c..c23403c66d 100644
--- a/qpid/cpp/src/qpid/sys/epoll/EpollPoller.cpp
+++ b/qpid/cpp/src/qpid/sys/epoll/EpollPoller.cpp
@@ -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);