aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/clickhouse/src/Storages/TableLockHolder.h
blob: 36fda2c69bb63a60dda34270a65c27d954c257f9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#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;

    TableLockHolder drop_lock;
};

}