+class hinfo {
+public:
+ rpcc *cl = nullptr;
+ int refcnt = 0;
+ bool del = false;
+ string m;
+ mutex client_mutex;
+ hinfo(const string & m_) : m(m_) {}
+};
+
+class handle_mgr {
+ private:
+ mutex mgr_mutex;
+ map<string, hinfo *> hmap;
+ void delete_handle(const string & m, lock & handle_mutex_lock);
+ public:
+ hinfo *acquire_handle(string m);
+ void release_handle(hinfo *h);
+ void delete_handle(const string & m);
+};
+
+static handle_mgr mgr;