#include "lock_server.h"
#include <sstream>
-#include <stdio.h>
#include <unistd.h>
#include <arpa/inet.h>
#include "lang/verify.h"
return *this;
}
-template <class A, class B>
-ostringstream & operator<<(ostringstream &o, const pair<A,B> &d) {
- o << "<" << d.first << "," << d.second << ">";
- return o;
-}
-
marshall & operator<<(marshall &m, const lock_state &d) {
return m << d.held << d.held_by << d.wanted_by;
}
rsm->set_state_transfer(this);
}
-void lock_server::revoker() {
+void lock_server::revoker() [[noreturn]] {
while (1) {
lock_protocol::lockid_t lid;
revoke_fifo.deq(&lid);
}
}
-void lock_server::retryer() {
+void lock_server::retryer() [[noreturn]] {
while (1) {
lock_protocol::lockid_t lid;
retry_fifo.deq(&lid);
}
}
-int lock_server::acquire(int &r, lock_protocol::lockid_t lid, string id, lock_protocol::xid_t xid) {
+int lock_server::acquire(int &, lock_protocol::lockid_t lid, string id, lock_protocol::xid_t xid) {
LOG_FUNC_ENTER_SERVER;
holder h = holder(id, xid);
lock_state &st = get_lock_state(lid);
if (!found)
st.wanted_by.push_back(h);
- LOG("wanted_by=" << JOIN(st.wanted_by.begin(), st.wanted_by.end(), " "));
+ LOG("wanted_by=" << make_iterator_pair(st.wanted_by.begin(), st.wanted_by.end()));
// send revoke if we're first in line
if (st.wanted_by.front() == h)
return lock_protocol::RETRY;
}
-int lock_server::release(int &r, lock_protocol::lockid_t lid, callback id, lock_protocol::xid_t xid) {
+int lock_server::release(int &, lock_protocol::lockid_t lid, callback id, lock_protocol::xid_t xid) {
LOG_FUNC_ENTER_SERVER;
lock_state &st = get_lock_state(lid);
lock sl(st.m);
}
lock_protocol::status lock_server::stat(int &r, lock_protocol::lockid_t lid) {
- printf("stat request\n");
+ LOG("stat request for " << lid);
VERIFY(0);
r = nacquire;
return lock_protocol::OK;