X-Git-Url: http://xvm.mit.edu/gitweb/invirt/third/libt4.git/blobdiff_plain/5fd8cc8409d0efadc07dfe8d6774ad9ff477663d..24bebc0ecf83446c7371eff69042322aab34976a:/rpc/pollmgr.h diff --git a/rpc/pollmgr.h b/rpc/pollmgr.h index c0a5748..a082843 100644 --- a/rpc/pollmgr.h +++ b/rpc/pollmgr.h @@ -1,8 +1,8 @@ #ifndef pollmgr_h #define pollmgr_h +#include "types.h" #include -#include #ifdef __linux__ #include @@ -23,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() {} }; @@ -54,9 +54,9 @@ class PollMgr { static int useless; private: - pthread_mutex_t m_; - pthread_cond_t changedone_c_; - pthread_t th_; + mutex m_; + cond changedone_c_; + thread th_; aio_callback *callbacks_[MAX_POLL_FDS]; aio_mgr *aio_; @@ -72,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: @@ -81,7 +81,7 @@ class SelectAIO : public aio_mgr { int highfds_; int pipefd_[2]; - pthread_mutex_t m_; + mutex m_; }; @@ -93,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_;