Major clean-ups. Migrating to C++11.
[invirt/third/libt4.git] / rpc / rpc.h
index fc61236..723121c 100644 (file)
--- a/rpc/rpc.h
+++ b/rpc/rpc.h
@@ -43,8 +43,8 @@ class rpcc : public chanmgr {
                        unmarshall *un;
                        int intret;
                        bool done;
-                       pthread_mutex_t m;
-                       pthread_cond_t c;
+            std::mutex m;
+            std::condition_variable c;
                };
 
                void get_refconn(connection **ch);
@@ -62,11 +62,11 @@ class rpcc : public chanmgr {
 
                connection *chan_;
 
-               pthread_mutex_t m_; // protect insert/delete to calls[]
-               pthread_mutex_t chan_m_;
+        std::mutex m_; // protect insert/delete to calls[]
+               std::mutex chan_m_;
 
                bool destroy_wait_;
-               pthread_cond_t destroy_wait_c_;
+        std::condition_variable destroy_wait_c_;
 
                std::map<int, caller *> calls_;
                std::list<unsigned int> xid_rep_window_;
@@ -328,10 +328,10 @@ class rpcs : public chanmgr {
        // map proc # to function
        std::map<int, handler *> procs_;
 
-       pthread_mutex_t procs_m_; // protect insert/delete to procs[]
-       pthread_mutex_t count_m_;  //protect modification of counts
-       pthread_mutex_t reply_window_m_; // protect reply window et al
-       pthread_mutex_t conss_m_; // protect conns_
+       std::mutex procs_m_; // protect insert/delete to procs[]
+       std::mutex count_m_;  //protect modification of counts
+       std::mutex reply_window_m_; // protect reply window et al
+       std::mutex conss_m_; // protect conns_
 
 
        protected:
@@ -626,8 +626,4 @@ void make_sockaddr(const char *hostandport, struct sockaddr_in *dst);
 void make_sockaddr(const char *host, const char *port,
                struct sockaddr_in *dst);
 
-int cmp_timespec(const struct timespec &a, const struct timespec &b);
-void add_timespec(const struct timespec &a, int b, struct timespec *result);
-int diff_timespec(const struct timespec &a, const struct timespec &b);
-
 #endif