]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#1239] addressed comments
authorRazvan Becheriu <razvan@isc.org>
Mon, 15 Jun 2020 15:19:52 +0000 (18:19 +0300)
committerRazvan Becheriu <razvan@isc.org>
Tue, 16 Jun 2020 09:02:52 +0000 (09:02 +0000)
src/lib/asiolink/interval_timer.h
src/lib/http/client.cc

index d61988fba91ac43667aee77371a594af050d7e26..0040a04341dfda6d05e29ca2cb55417ed9375211 100644 (file)
@@ -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
index d907187577d631564b78620360951967a0a89257..3f0af351f0fb71f48c871d16aab13aa960ddaf60 100644 (file)
@@ -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<std::mutex> 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.