X-Git-Url: http://xvm.mit.edu/gitweb/invirt/third/libt4.git/blobdiff_plain/61809b48ade4c21b1b01931d520aa2abc7507032..a4175b2e216a20b86cc872dea8a08005c60617a5:/lock_client_cache_rsm.h?ds=sidebyside diff --git a/lock_client_cache_rsm.h b/lock_client_cache_rsm.h index 28b0323..049d18a 100644 --- a/lock_client_cache_rsm.h +++ b/lock_client_cache_rsm.h @@ -6,23 +6,22 @@ #include #include "lock_protocol.h" -#include "rpc.h" +#include "rpc/rpc.h" #include "lock_client.h" #include "lang/verify.h" -#include "mutex.h" #include "rpc/fifo.h" #include "rsm_client.h" -// Classes that inherit lock_release_user can override dorelease so that -// that they will be called when lock_client releases a lock. -// You will not need to do anything with this class until Lab 5. class lock_release_user { public: virtual void dorelease(lock_protocol::lockid_t) = 0; virtual ~lock_release_user() {}; }; -using namespace std; +using std::string; +using std::thread; +using std::list; +using std::map; typedef string callback; @@ -37,14 +36,14 @@ public: acquiring, releasing } state; - pthread_t held_by; - list wanted_by; + std::thread::id held_by; + list wanted_by; mutex m; - map c; + map c; lock_protocol::xid_t xid; void wait(); void signal(); - void signal(pthread_t who); + void signal(std::thread::id who); }; typedef map lock_map; @@ -55,7 +54,7 @@ class lock_client_cache_rsm; // lock_revoke_server. class lock_client_cache_rsm : public lock_client { private: - pthread_t releaser_thread; + std::thread releaser_thread; rsm_client *rsmc; class lock_release_user *lu; int rlock_port;