memgraph/threading/sync/lockable.hpp
2015-08-30 01:12:46 +02:00

20 lines
307 B
C++

#ifndef MEMGRAPH_SYNC_LOCKABLE_HPP
#define MEMGRAPH_SYNC_LOCKABLE_HPP
#include <mutex>
#include "spinlock.hpp"
template <class lock_t = SpinLock>
class Lockable
{
protected:
std::unique_lock<lock_t> acquire()
{
return std::unique_lock<lock_t>(lock);
}
lock_t lock;
};
#endif