ClickHouse/src/Storages/TableLockHolder.h
2020-06-22 12:49:21 +03:00

25 lines
428 B
C++

#pragma once
#include <Common/RWLock.h>
namespace DB
{
using TableLockHolder = RWLockImpl::LockHolder;
/// Table exclusive lock, holds both alter and drop locks. Useful for DROP-like
/// queries.
struct TableExclusiveLockHolder
{
void release() { *this = TableExclusiveLockHolder(); }
private:
friend class IStorage;
/// Order is important.
TableLockHolder alter_lock;
TableLockHolder drop_lock;
};
}