several minor problems found while developing pvDatabaseCPP

This commit is contained in:
Marty Kraimer
2012-12-12 14:59:33 -05:00
parent 18ba24156c
commit 4bc7e9c8fe
5 changed files with 29 additions and 11 deletions
+9
View File
@@ -44,6 +44,15 @@ public:
locked=false;
}
}
bool tryLock()
{
if(locked) return true;
if(mutexPtr.tryLock()) {
locked = true;
return true;
}
return false;
}
bool ownsLock() const{return locked;}
private:
Mutex &mutexPtr;