mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-19 14:11:58 +00:00
17 lines
391 B
C++
17 lines
391 B
C++
#include <Storages/IStorage.h>
|
|
|
|
|
|
namespace DB
|
|
{
|
|
|
|
TableStructureReadLock::TableStructureReadLock(StoragePtr storage_, bool lock_structure, bool lock_data)
|
|
: storage(storage_), data_lock(storage->data_lock, std::defer_lock), structure_lock(storage->structure_lock, std::defer_lock)
|
|
{
|
|
if (lock_data)
|
|
data_lock.lock();
|
|
if (lock_structure)
|
|
structure_lock.lock();
|
|
}
|
|
|
|
}
|