#include "rsm.h"
#include "rpc/fifo.h"
-typedef string callback_t;
typedef pair<callback_t, lock_protocol::xid_t> holder_t;
class lock_state {
MEMBERS(held, held_by, wanted_by)
};
-MARSHALLABLE(lock_state)
+MARSHALLABLE_STRUCT(lock_state)
typedef map<lock_protocol::lockid_t, lock_state> lock_map;
rsm *rsm_;
public:
lock_server(rsm *r = 0);
- lock_protocol::status stat(int &, lock_protocol::lockid_t);
- void revoker();
- void retryer();
+ void revoker NORETURN ();
+ void retryer NORETURN ();
string marshal_state();
- void unmarshal_state(string state);
- int acquire(int &, lock_protocol::lockid_t, string id, lock_protocol::xid_t);
- int release(int &, lock_protocol::lockid_t, string id, lock_protocol::xid_t);
+ void unmarshal_state(const string & state);
+ lock_protocol::status acquire(int &, lock_protocol::lockid_t, const callback_t & id, lock_protocol::xid_t);
+ lock_protocol::status release(int &, lock_protocol::lockid_t, const callback_t & id, lock_protocol::xid_t);
+ lock_protocol::status stat(int &, lock_protocol::lockid_t, const callback_t & id);
};
#endif