diff --git a/repertory/librepertory/src/comm/packet/packet_server.cpp b/repertory/librepertory/src/comm/packet/packet_server.cpp index 40b23280..c8782a8c 100644 --- a/repertory/librepertory/src/comm/packet/packet_server.cpp +++ b/repertory/librepertory/src/comm/packet/packet_server.cpp @@ -68,7 +68,7 @@ void packet_server::add_client(connection &conn, const std::string &client_id) { void packet_server::initialize(const uint16_t &port, uint8_t pool_size) { REPERTORY_USES_FUNCTION_NAME(); - pool_size = std::max(uint8_t(1U), pool_size); + pool_size = std::max(std::uint8_t(1U), pool_size); server_thread_ = std::make_unique([this, port, pool_size]() { tcp::acceptor acceptor(io_context_); try { diff --git a/repertory/librepertory/src/utils/polling.cpp b/repertory/librepertory/src/utils/polling.cpp index 4bd2178a..8b42c84d 100644 --- a/repertory/librepertory/src/utils/polling.cpp +++ b/repertory/librepertory/src/utils/polling.cpp @@ -30,27 +30,28 @@ void polling::frequency_thread( std::function get_frequency_seconds, frequency freq) { while (not stop_requested_) { std::deque> futures; - unique_mutex_lock l(mutex_); + unique_mutex_lock lock(mutex_); if (not stop_requested_ && - notify_.wait_for(l, std::chrono::seconds(get_frequency_seconds())) == + notify_.wait_for(lock, std::chrono::seconds(get_frequency_seconds())) == std::cv_status::timeout) { - for (const auto &kv : items_) { - if (kv.second.freq == freq) { + for (const auto &item : items_) { + if (item.second.freq == freq) { futures.emplace_back( - std::async(std::launch::async, [this, &freq, kv]() -> void { + std::async(std::launch::async, [this, &freq, item]() -> void { if (config_->get_event_level() == event_level::trace || freq != frequency::second) { - event_system::instance().raise(kv.first); + event_system::instance().raise( + item.first); } - kv.second.action(); + item.second.action(); if (config_->get_event_level() == event_level::trace || freq != frequency::second) { - event_system::instance().raise(kv.first); + event_system::instance().raise(item.first); } })); } } - l.unlock(); + lock.unlock(); while (not futures.empty()) { futures.front().wait(); @@ -61,17 +62,17 @@ void polling::frequency_thread( } void polling::remove_callback(const std::string &name) { - mutex_lock l(mutex_); + mutex_lock lock(mutex_); items_.erase(name); } -void polling::set_callback(const polling_item &pi) { - mutex_lock l(mutex_); - items_[pi.name] = pi; +void polling::set_callback(const polling_item &item) { + mutex_lock lock(mutex_); + items_[item.name] = item; } void polling::start(app_config *config) { - mutex_lock l(start_stop_mutex_); + mutex_lock lock(start_stop_mutex_); if (not high_frequency_thread_) { event_system::instance().raise("polling"); config_ = config; @@ -100,12 +101,12 @@ void polling::start(app_config *config) { void polling::stop() { if (high_frequency_thread_) { event_system::instance().raise("polling"); - mutex_lock l(start_stop_mutex_); + mutex_lock lock(start_stop_mutex_); if (high_frequency_thread_) { { stop_requested_ = true; - mutex_lock l2(mutex_); + mutex_lock lock2(mutex_); notify_.notify_all(); } high_frequency_thread_->join();