mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 09:32:06 +00:00
Remove mutex
This commit is contained in:
parent
3649f10444
commit
220c0255ab
@ -72,7 +72,6 @@ template <typename LogElement>
|
||||
void SystemLogBase<LogElement>::startup()
|
||||
{
|
||||
std::lock_guard lock(queue->mutex);
|
||||
std::cout << "void ISystemLog::startup()" << std::endl;
|
||||
saving_thread = std::make_unique<ThreadFromGlobalPool>([this] { savingThreadFunction(); });
|
||||
}
|
||||
|
||||
|
@ -37,7 +37,6 @@ static std::string createDirectory(const std::string & file)
|
||||
|
||||
void Loggers::buildLoggers(Poco::Util::AbstractConfiguration & config, Poco::Logger & logger /*_root*/, const std::string & cmd_name)
|
||||
{
|
||||
|
||||
auto current_logger = config.getString("logger", "");
|
||||
if (config_logger.has_value() && *config_logger == current_logger)
|
||||
return;
|
||||
@ -51,9 +50,12 @@ void Loggers::buildLoggers(Poco::Util::AbstractConfiguration & config, Poco::Log
|
||||
split = new DB::OwnSplitChannel();
|
||||
|
||||
#ifndef WITHOUT_TEXT_LOG
|
||||
String text_log_level_str = config.getString("text_log.level", "");
|
||||
int text_log_level = text_log_level_str.empty() ? INT_MAX : Poco::Logger::parseLevel(text_log_level_str);
|
||||
split->addTextLog(DB::TextLog::getLogQueue(), text_log_level);
|
||||
if (config.has("text_log"))
|
||||
{
|
||||
String text_log_level_str = config.getString("text_log.level", "");
|
||||
int text_log_level = text_log_level_str.empty() ? INT_MAX : Poco::Logger::parseLevel(text_log_level_str);
|
||||
split->addTextLog(DB::TextLog::getLogQueue(), text_log_level);
|
||||
}
|
||||
#endif
|
||||
|
||||
auto log_level_string = config.getString("logger.level", "trace");
|
||||
|
@ -136,10 +136,7 @@ void OwnSplitChannel::logSplit(const Poco::Message & msg)
|
||||
elem.message_format_string = msg.getFormatString();
|
||||
|
||||
std::shared_ptr<SystemLogQueue<TextLogElement>> text_log_locked{};
|
||||
{
|
||||
std::lock_guard lock(text_log_mutex);
|
||||
text_log_locked = text_log.lock();
|
||||
}
|
||||
text_log_locked = text_log.lock();
|
||||
if (text_log_locked)
|
||||
text_log_locked->add(elem);
|
||||
}
|
||||
@ -155,7 +152,6 @@ void OwnSplitChannel::addChannel(Poco::AutoPtr<Poco::Channel> channel, const std
|
||||
#ifndef WITHOUT_TEXT_LOG
|
||||
void OwnSplitChannel::addTextLog(std::shared_ptr<SystemLogQueue<TextLogElement>> log_queue, int max_priority)
|
||||
{
|
||||
std::lock_guard lock(text_log_mutex);
|
||||
text_log = log_queue;
|
||||
text_log_max_priority.store(max_priority, std::memory_order_relaxed);
|
||||
}
|
||||
|
@ -47,8 +47,6 @@ private:
|
||||
using ExtendedChannelPtrPair = std::pair<ChannelPtr, ExtendedLogChannel *>;
|
||||
std::map<std::string, ExtendedChannelPtrPair> channels;
|
||||
|
||||
std::mutex text_log_mutex;
|
||||
|
||||
#ifndef WITHOUT_TEXT_LOG
|
||||
std::weak_ptr<DB::FooBar> text_log;
|
||||
std::atomic<int> text_log_max_priority = -1;
|
||||
|
Loading…
Reference in New Issue
Block a user