X-Git-Url: http://xvm.mit.edu/gitweb/invirt/third/libt4.git/blobdiff_plain/26ade07ab0e62b98b452fbbd18edba0450035e35..03b35a9a1bd1f583e32b27d260b223a0989d6c75:/lock_client.cc diff --git a/lock_client.cc b/lock_client.cc index 7a44940..9949eac 100644 --- a/lock_client.cc +++ b/lock_client.cc @@ -4,7 +4,7 @@ #include void lock_state::wait(lock & mutex_lock) { - auto self = this_thread::get_id(); + auto self = std::this_thread::get_id(); c[self].wait(mutex_lock); c.erase(self); } @@ -20,8 +20,6 @@ void lock_state::signal(thread::id who) { c[who].notify_one(); } -typedef map lock_map; - in_port_t lock_client::last_port = 0; lock_state & lock_client::get_lock_state(lock_protocol::lockid_t lid) { @@ -36,7 +34,7 @@ lock_client::lock_client(string xdst, lock_release_user *_lu) : lu(_lu), next_xi srandom((uint32_t)time(NULL)^last_port); rlock_port = ((random()%32000) | (0x1 << 10)); - id = "127.0.0.1:" + to_string(rlock_port); + id = "127.0.0.1:" + std::to_string(rlock_port); last_port = rlock_port; rlsrpc = unique_ptr(new rpcs(rlock_port)); rlsrpc->reg(rlock_protocol::revoke, &lock_client::revoke_handler, this); @@ -81,7 +79,7 @@ int lock_client::stat(lock_protocol::lockid_t lid) { lock_protocol::status lock_client::acquire(lock_protocol::lockid_t lid) { lock_state & st = get_lock_state(lid); lock sl(st.m); - auto self = this_thread::get_id(); + auto self = std::this_thread::get_id(); // check for reentrancy VERIFY(st.state != lock_state::locked || st.held_by != self); @@ -147,7 +145,7 @@ lock_protocol::status lock_client::acquire(lock_protocol::lockid_t lid) { lock_protocol::status lock_client::release(lock_protocol::lockid_t lid) { lock_state & st = get_lock_state(lid); lock sl(st.m); - auto self = this_thread::get_id(); + auto self = std::this_thread::get_id(); VERIFY(st.state == lock_state::locked && st.held_by == self); st.state = lock_state::free; LOG << "Lock " << lid << ": free";