X-Git-Url: http://xvm.mit.edu/gitweb/invirt/third/libt4.git/blobdiff_plain/a4175b2e216a20b86cc872dea8a08005c60617a5..46fb2b4bbe3a0a8516ab04cfafa895a882c70f86:/rpc/pollmgr.h diff --git a/rpc/pollmgr.h b/rpc/pollmgr.h index 89d1660..a082843 100644 --- a/rpc/pollmgr.h +++ b/rpc/pollmgr.h @@ -1,9 +1,8 @@ #ifndef pollmgr_h #define pollmgr_h +#include "types.h" #include -#include -#include #ifdef __linux__ #include @@ -24,7 +23,7 @@ class aio_mgr { virtual void watch_fd(int fd, poll_flag flag) = 0; virtual bool unwatch_fd(int fd, poll_flag flag) = 0; virtual bool is_watched(int fd, poll_flag flag) = 0; - virtual void wait_ready(std::vector *readable, std::vector *writable) = 0; + virtual void wait_ready(vector *readable, vector *writable) = 0; virtual ~aio_mgr() {} }; @@ -55,9 +54,9 @@ class PollMgr { static int useless; private: - std::mutex m_; - std::condition_variable changedone_c_; - std::thread th_; + mutex m_; + cond changedone_c_; + thread th_; aio_callback *callbacks_[MAX_POLL_FDS]; aio_mgr *aio_; @@ -73,7 +72,7 @@ class SelectAIO : public aio_mgr { void watch_fd(int fd, poll_flag flag); bool unwatch_fd(int fd, poll_flag flag); bool is_watched(int fd, poll_flag flag); - void wait_ready(std::vector *readable, std::vector *writable); + void wait_ready(vector *readable, vector *writable); private: @@ -82,7 +81,7 @@ class SelectAIO : public aio_mgr { int highfds_; int pipefd_[2]; - std::mutex m_; + mutex m_; }; @@ -94,7 +93,7 @@ class EPollAIO : public aio_mgr { void watch_fd(int fd, poll_flag flag); bool unwatch_fd(int fd, poll_flag flag); bool is_watched(int fd, poll_flag flag); - void wait_ready(std::vector *readable, std::vector *writable); + void wait_ready(vector *readable, vector *writable); private: int pollfd_;