X-Git-Url: http://xvm.mit.edu/gitweb/invirt/third/libt4.git/blobdiff_plain/f2170465073de34adf89161d4287182b518352c4..2546a41ad36fdc9ef6471cb35a1d56930ae1b527:/handle.h diff --git a/handle.h b/handle.h index 6b042fb..a06b156 100644 --- a/handle.h +++ b/handle.h @@ -23,23 +23,18 @@ #ifndef handle_h #define handle_h -#include -#include #include "rpc/rpc.h" +#include -struct hinfo { - rpcc *cl; - int refcnt; - bool del; - std::string m; - std::mutex cl_mutex; -}; +using std::string; + +class hinfo; class handle { private: - struct hinfo *h; + hinfo *h; public: - handle(std::string m); + handle(const string & m); ~handle(); /* safebind will try to bind with the rpc server on the first call. * Since bind may block, the caller probably should not hold a mutex @@ -62,18 +57,6 @@ class handle { rpcc *safebind(); }; -class handle_mgr { - private: - std::mutex handle_mutex; - std::map hmap; - public: - handle_mgr(); - struct hinfo *get_handle(std::string m); - void done_handle(struct hinfo *h); - void delete_handle(std::string m); - void delete_handle_wo(std::string m); -}; - -extern class handle_mgr mgr; +void invalidate_handle(const string & m); #endif