diff options
Diffstat (limited to 'src/mbgl/util/exclusive.hpp')
-rw-r--r-- | src/mbgl/util/exclusive.hpp | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/src/mbgl/util/exclusive.hpp b/src/mbgl/util/exclusive.hpp deleted file mode 100644 index 844588dc90..0000000000 --- a/src/mbgl/util/exclusive.hpp +++ /dev/null @@ -1,27 +0,0 @@ -#pragma once - -#include <memory> -#include <mutex> - - -namespace mbgl { -namespace util { - -template <class T> -class exclusive { -public: - exclusive(T* val, std::unique_ptr<std::lock_guard<std::mutex>> mtx) : ptr(val), lock(std::move(mtx)) {} - - T* operator->() { return ptr; } - const T* operator->() const { return ptr; } - T* operator*() { return ptr; } - const T* operator*() const { return ptr; } - -private: - T *ptr; - std::unique_ptr<std::lock_guard<std::mutex>> lock; -}; - - -} // end namespace util -} // end namespace mbgl |