#pragma once

#include "Core/Constant.h"

template <class T>
class ScopeLock {
    NON_COPYABLE(ScopeLock)

public:
    explicit ScopeLock(T* lock) noexcept
        : lock_(lock) {
        lock_->Lock();
    }
    ~ScopeLock() noexcept {
        lock_->Unlock();
    }

private:
    T* lock_;
};
