RPC procedures are now identified via a struct containing a string name.
[invirt/third/libt4.git] / lock_client.h
index 5cdb26e..9e449f4 100644 (file)
@@ -9,6 +9,7 @@
 #include "lock_protocol.h"
 #include "rpc/fifo.h"
 #include "rsm_client.h"
+#include "maybe.h"
 
 class lock_release_user {
     public:
@@ -42,7 +43,6 @@ typedef std::map<lock_protocol::lockid_t, lock_state> lock_map;
 // lock_revoke_server.
 class lock_client {
     private:
-        unique_ptr<rpcc> cl;
         unique_ptr<rpcs> rlsrpc;
         thread releaser_thread;
         unique_ptr<rsm_client> rsmc;
@@ -52,18 +52,16 @@ class lock_client {
         string id;
         std::mutex xid_mutex;
         lock_protocol::xid_t next_xid;
-        fifo<lock_protocol::lockid_t> release_fifo;
+        fifo<maybe<lock_protocol::lockid_t>> release_fifo;
         std::mutex lock_table_lock;
         lock_map lock_table;
         lock_state & get_lock_state(lock_protocol::lockid_t lid);
     public:
-        static in_port_t last_port;
         lock_client(string xdst, lock_release_user *l = 0);
-        ~lock_client() {}
+        ~lock_client();
         lock_protocol::status acquire(lock_protocol::lockid_t);
         lock_protocol::status release(lock_protocol::lockid_t);
-        int stat(lock_protocol::lockid_t);
-        void releaser NORETURN ();
+        void releaser();
         rlock_protocol::status revoke_handler(int &, lock_protocol::lockid_t, lock_protocol::xid_t);
         rlock_protocol::status retry_handler(int &, lock_protocol::lockid_t, lock_protocol::xid_t);
 };
@@ -93,7 +91,6 @@ t4_lock_client *t4_lock_client_new(const char *dst);
 void t4_lock_client_delete(t4_lock_client *);
 t4_status t4_lock_client_acquire(t4_lock_client *, t4_lockid_t);
 t4_status t4_lock_client_release(t4_lock_client *, t4_lockid_t);
-t4_status t4_lock_client_stat(t4_lock_client *, t4_lockid_t);
 
 #ifdef __cplusplus
 }