Context getGlobalTemporaryVolume use shared lock

This commit is contained in:
Maksim Kita 2024-03-07 11:59:41 +03:00
parent 03feab3d20
commit 414f3aebef

View File

@ -971,7 +971,7 @@ Strings Context::getWarnings() const
/// TODO: remove, use `getTempDataOnDisk` /// TODO: remove, use `getTempDataOnDisk`
VolumePtr Context::getGlobalTemporaryVolume() const VolumePtr Context::getGlobalTemporaryVolume() const
{ {
std::lock_guard lock(shared->mutex); SharedLockGuard lock(shared->mutex);
/// Calling this method we just bypass the `temp_data_on_disk` and write to the file on the volume directly. /// Calling this method we just bypass the `temp_data_on_disk` and write to the file on the volume directly.
/// Volume is the same for `root_temp_data_on_disk` (always set) and `temp_data_on_disk` (if it's set). /// Volume is the same for `root_temp_data_on_disk` (always set) and `temp_data_on_disk` (if it's set).
if (shared->root_temp_data_on_disk) if (shared->root_temp_data_on_disk)