mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-19 06:01:57 +00:00
17 lines
407 B
C++
17 lines
407 B
C++
#include <Storages/IStorage.h>
|
|
|
|
|
|
namespace DB
|
|
{
|
|
|
|
TableStructureReadLock::TableStructureReadLock(StoragePtr storage_, bool lock_structure, bool lock_data, const std::string & who)
|
|
: storage(storage_)
|
|
{
|
|
if (lock_data)
|
|
data_lock = storage->data_lock->getLock(RWLockFIFO::Read, who);
|
|
if (lock_structure)
|
|
structure_lock = storage->structure_lock->getLock(RWLockFIFO::Read, who);
|
|
}
|
|
|
|
}
|