1 // the lock server implementation
3 #include "lock_server.h"
9 lock_server::lock_server():
14 // caller must hold lock_lock
16 lock_server::get_lock(lock_protocol::lockid_t lid) {
18 // by the semantics of std::map, this will create
19 // the mutex if it doesn't already exist
20 mutex &l = locks[lid];
26 lock_server::stat(int clt, lock_protocol::lockid_t lid, int &r)
28 lock_protocol::status ret = lock_protocol::OK;
29 printf("stat request from clt %d\n", clt);
35 lock_server::acquire(int clt, lock_protocol::lockid_t lid, int &r)
37 get_lock(lid).acquire();
38 return lock_protocol::OK;
42 lock_server::release(int clt, lock_protocol::lockid_t lid, int &r)
44 get_lock(lid).release();
45 return lock_protocol::OK;