ClickHouse/src/Storages/TableStructureLockHolder.h

22 lines
348 B
C++
Raw Normal View History

2019-03-05 10:12:20 +00:00
#pragma once
#include <Common/RWLock.h>
namespace DB
{
2020-06-18 16:10:47 +00:00
struct TableExclusiveLockHolder
{
2020-06-18 16:10:47 +00:00
void release() { *this = TableExclusiveLockHolder(); }
2019-08-27 14:31:34 +00:00
private:
friend class IStorage;
/// Order is important.
2020-06-18 16:10:47 +00:00
RWLockImpl::LockHolder alter_lock;
RWLockImpl::LockHolder drop_lock;
2019-03-05 10:12:20 +00:00
};
2020-06-18 16:10:47 +00:00
using TableLockHolder = RWLockImpl::LockHolder;
2019-03-05 10:12:20 +00:00
}