Build on wheezy, and presumably precise
[invirt/third/libt4.git] / srlock.cc
1 #include "srlock.h"
2
3 ScopedRemoteLock::ScopedRemoteLock(lock_client *lc, lock_protocol::lockid_t lid) :
4     lc_(lc), lid_(lid) {
5     lc_->acquire(lid_);
6     releaseOnFree = true;
7 }
8
9 void ScopedRemoteLock::retain() {
10     releaseOnFree = false;
11 }
12
13 ScopedRemoteLock::~ScopedRemoteLock() {
14     if (releaseOnFree)
15         lc_->release(lid_);
16 }