More cleaning
[invirt/third/libt4.git] / rpc / pollmgr.h
index c0a5748..a082843 100644 (file)
@@ -1,8 +1,8 @@
 #ifndef pollmgr_h
 #define pollmgr_h 
 
+#include "types.h"
 #include <sys/select.h>
-#include <vector>
 
 #ifdef __linux__
 #include <sys/epoll.h>
@@ -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<int> *readable, std::vector<int> *writable) = 0;
+               virtual void wait_ready(vector<int> *readable, vector<int> *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<int> *readable, std::vector<int> *writable);
+               void wait_ready(vector<int> *readable, vector<int> *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<int> *readable, std::vector<int> *writable);
+               void wait_ready(vector<int> *readable, vector<int> *writable);
 
        private:
                int pollfd_;