diff options
| author | Andrew Stitcher <astitcher@apache.org> | 2012-08-02 20:17:03 +0000 |
|---|---|---|
| committer | Andrew Stitcher <astitcher@apache.org> | 2012-08-02 20:17:03 +0000 |
| commit | 970e4c39dbb885db631f0366794be7645d67d007 (patch) | |
| tree | d5724db10558ea33fbe9bf3e2a697f87c6051d39 /cpp/src | |
| parent | bcd567070d90829bb0a820286a0a2978e882afcd (diff) | |
| download | qpid-python-970e4c39dbb885db631f0366794be7645d67d007.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/qpid@1368685 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src')
| -rw-r--r-- | cpp/src/qpid/sys/epoll/EpollPoller.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/cpp/src/qpid/sys/epoll/EpollPoller.cpp b/cpp/src/qpid/sys/epoll/EpollPoller.cpp index dcc9d9181c..c23403c66d 100644 --- a/cpp/src/qpid/sys/epoll/EpollPoller.cpp +++ b/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); |
