mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Cleanup.
This commit is contained in:
@@ -4,6 +4,11 @@
|
|||||||
#include <boost/thread/recursive_mutex.hpp>
|
#include <boost/thread/recursive_mutex.hpp>
|
||||||
#include <boost/interprocess/sync/scoped_lock.hpp>
|
#include <boost/interprocess/sync/scoped_lock.hpp>
|
||||||
#include <boost/shared_ptr.hpp>
|
#include <boost/shared_ptr.hpp>
|
||||||
|
#include <boost/make_shared.hpp>
|
||||||
|
#include <boost/ref.hpp>
|
||||||
|
|
||||||
|
// A lock holder that can be returned and copied by value
|
||||||
|
// When the last reference goes away, the lock is released
|
||||||
|
|
||||||
class ScopedLock
|
class ScopedLock
|
||||||
{
|
{
|
||||||
@@ -12,7 +17,7 @@ protected:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
ScopedLock(boost::recursive_mutex& mutex) :
|
ScopedLock(boost::recursive_mutex& mutex) :
|
||||||
mHolder(new boost::interprocess::scoped_lock<boost::recursive_mutex>(mutex))
|
mHolder(boost::make_shared<boost::interprocess::scoped_lock<boost::recursive_mutex> >(boost::ref(mutex)))
|
||||||
{ ; }
|
{ ; }
|
||||||
void lock() const
|
void lock() const
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user