mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-20 11:05:54 +00:00
Tiny mistake in previous commit.
This commit is contained in:
11
ScopedLock.h
11
ScopedLock.h
@@ -6,15 +6,15 @@
|
||||
// This is a returnable lock holder.
|
||||
// I don't know why Boost doesn't provide a good way to do this.
|
||||
|
||||
class ScopedLock
|
||||
{
|
||||
private:
|
||||
class ScopedLock
|
||||
{
|
||||
private:
|
||||
boost::mutex *mMutex; // parent object has greater scope, so guaranteed valid
|
||||
mutable bool mValid;
|
||||
|
||||
ScopedLock(); // no implementation
|
||||
|
||||
public:
|
||||
public:
|
||||
ScopedLock(boost::mutex &mutex) : mMutex(&mutex), mValid(true)
|
||||
{
|
||||
mMutex->lock();
|
||||
@@ -42,11 +42,10 @@ public:
|
||||
mMutex=sl.mMutex;
|
||||
if(sl.mValid)
|
||||
{
|
||||
if(mValid) mMutex->unlock();
|
||||
mValid=true;
|
||||
sl.mValid=false;
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user