X-Git-Url: http://xvm.mit.edu/gitweb/invirt/third/libt4.git/blobdiff_plain/02967a43024ce81912cd1ec96a800397457f8066..ab9eee5d7f1fbe7a3fe6229d4a78136efb14371b:/lock_server.cc diff --git a/lock_server.cc b/lock_server.cc index 86e5ad2..1241409 100644 --- a/lock_server.cc +++ b/lock_server.cc @@ -1,27 +1,17 @@ // the caching lock server implementation -#include "lock_server.h" +#include "include/lock_server.h" #include #include -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]; @@ -151,12 +141,12 @@ lock_protocol::status lock_server::release(int &, lock_protocol::lockid_t lid, c 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); }