make TSAN happy

This commit is contained in:
Han Fei 2024-03-27 10:21:16 +01:00
parent 2110bfd278
commit af2e86d72d
3 changed files with 3 additions and 4 deletions

View File

@ -81,7 +81,7 @@ void RefreshSet::emplace(StorageID id, const std::vector<StorageID> & dependenci
throw Exception(ErrorCodes::LOGICAL_ERROR, "Refresh set entry already exists for table {}", id.getFullTableName());
addDependenciesLocked(id, dependencies);
task->setRefreshSetHandle(Handle(this, id, dependencies));
task->setRefreshSetHandleUnlock(Handle(this, id, dependencies));
}
void RefreshSet::addDependenciesLocked(const StorageID & id, const std::vector<StorageID> & dependencies)

View File

@ -509,9 +509,8 @@ std::chrono::system_clock::time_point RefreshTask::currentTime() const
return std::chrono::system_clock::time_point(std::chrono::seconds(fake));
}
void RefreshTask::setRefreshSetHandle(RefreshSet::Handle && set_handle_)
void RefreshTask::setRefreshSetHandleUnlock(RefreshSet::Handle && set_handle_)
{
std::lock_guard guard(mutex);
set_handle = std::move(set_handle_);
}

View File

@ -62,7 +62,7 @@ public:
void setFakeTime(std::optional<Int64> t);
/// RefreshSet will set handle for refresh tasks, to avoid race condition.
void setRefreshSetHandle(RefreshSet::Handle && set_handle_);
void setRefreshSetHandleUnlock(RefreshSet::Handle && set_handle_);
private:
LoggerPtr log = nullptr;