From: Razvan Becheriu Date: Mon, 15 Jun 2020 15:19:52 +0000 (+0300) Subject: [#1239] addressed comments X-Git-Tag: Kea-1.7.9~52 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c794c12246b0ff4910a563347026d5f4ede7f588;p=thirdparty%2Fkea.git [#1239] addressed comments --- diff --git a/src/lib/asiolink/interval_timer.h b/src/lib/asiolink/interval_timer.h index d61988fba9..0040a04341 100644 --- a/src/lib/asiolink/interval_timer.h +++ b/src/lib/asiolink/interval_timer.h @@ -49,6 +49,12 @@ class IntervalTimerImpl; /// intervalTimer.setup(function_to_call_back, interval_in_milliseconds); /// io_service.run(); /// \endcode +/// +/// @note Only scheduling new timer (calling @ref setup) and canceling existing +/// timer (calling @ref cancel) are thread safe. +/// Registering new timers (calling @ref registerTimer) and unregistering +/// existing timers (calling @ref unregisterTimer) must be handled before +/// starting processing threads. class IntervalTimer { public: /// \name The type of timer callback function diff --git a/src/lib/http/client.cc b/src/lib/http/client.cc index d907187577..3f0af351f0 100644 --- a/src/lib/http/client.cc +++ b/src/lib/http/client.cc @@ -420,10 +420,7 @@ public: /// @brief Process next queued request for the given URL. /// /// @param url URL for which next queued request should be processed. - /// - /// @return true if the request for the given URL has been processed, - /// false if there are no more requests queued for this URL. - bool processNextRequest(const Url& url) { + void processNextRequest(const Url& url) { if (MultiThreadingMgr::instance().getMode()) { std::lock_guard lk(mutex_); return (processNextRequestInternal(url)); @@ -520,10 +517,7 @@ private: /// This method should be called in a thread safe context. /// /// @param url URL for which next queued request should be retrieved. - /// - /// @return true if the request for the given URL has been processed, - /// false if there are no more requests queued for this URL. - bool processNextRequestInternal(const Url& url) { + void processNextRequestInternal(const Url& url) { // Check if there is a queue for this URL. If there is no queue, there // is no request queued either. auto it = queue_.find(url); @@ -536,11 +530,8 @@ private: desc.request_timeout_, desc.callback_, desc.connect_callback_, desc.close_callback_); - return (true); } } - - return (false); } /// @brief Queue next request for sending to the server.