// the caching lock server implementation
-#include "lock_server.h"
+#include "include/lock_server.h"
#include <unistd.h>
#include <arpa/inet.h>
-lock_state::lock_state():
- held(false)
-{
+lock_server::lock_state::lock_state(const lock_state & other) {
+ held = other.held;
+ held_by = other.held_by;
+ wanted_by = other.wanted_by;
+ old_requests = other.old_requests;
}
-lock_state::lock_state(const lock_state & other) {
- *this = other;
-}
-
-lock_state & lock_state::operator=(const lock_state & o) {
- held = o.held;
- held_by = o.held_by;
- wanted_by = o.wanted_by;
- old_requests = o.old_requests;
- return *this;
-}
-
-lock_state & lock_server::get_lock_state(lock_protocol::lockid_t lid) {
+lock_server::lock_state & lock_server::get_lock_state(lock_protocol::lockid_t lid) {
lock sl(lock_table_lock);
// this will create the lock if it doesn't already exist
return lock_table[lid];
return lock_protocol::OK;
}
-string lock_server::marshal_state() {
+string lock_server::marshall_state() {
lock sl(lock_table_lock);
- return marshall(nacquire, lock_table).content();
+ return marshall(nacquire, lock_table);
}
-void lock_server::unmarshal_state(const string & state) {
+void lock_server::unmarshall_state(const string & state) {
lock sl(lock_table_lock);
- unmarshall(state, false, nacquire, lock_table);
+ unmarshall(state, nacquire, lock_table);
}