]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#1016] minor changes
authorRazvan Becheriu <razvan@isc.org>
Thu, 27 Feb 2020 13:11:16 +0000 (15:11 +0200)
committerRazvan Becheriu <razvan@isc.org>
Fri, 6 Mar 2020 11:05:59 +0000 (13:05 +0200)
src/lib/dhcpsrv/multi_threading_utils.h
src/lib/dhcpsrv/tests/multi_threading_utils_unittest.cc
src/lib/util/multi_threading_mgr.h

index 533a7f84ca36c689cab7fbcad468523ff3a842a4..63faee7898808147de9f3c734de9b3b044e1e53a 100644 (file)
@@ -21,7 +21,7 @@ namespace dhcp {
 /// @c MultiThreadingCriticalSection body.
 /// @note: starting and stopping the packet thread pool should be handled
 /// in the main thread, if done on one of the processing threads will cause a
-/// deadlock
+/// deadlock.
 /// This is mainly useful in hook commands which handle configuration
 /// changes.
 class MultiThreadingCriticalSection : public boost::noncopyable {
@@ -30,13 +30,13 @@ public:
     /// @brief Constructor.
     ///
     /// Entering the critical section. The packet thread pool instance will be
-    /// stopped so that configuration changes can be safely applied.
+    /// stopped so that all configuration changes can be safely applied.
     MultiThreadingCriticalSection();
 
     /// @brief Destructor.
     ///
     /// Leaving the critical section. The packet thread pool instance will be
-    /// started according to new configuration.
+    /// started according to the new configuration.
     virtual ~MultiThreadingCriticalSection();
 
 private:
index 10c28b57af14f77ec11038a56d2342b52529d320..c97b576910089602b954afe842d035eb0911ccbe 100644 (file)
@@ -90,9 +90,7 @@ TEST(MultiThreadingUtil, constructorAndDestructor) {
     // thread count should match
     EXPECT_EQ(thread_pool.size(), 64);
     // apply multi-threading configuration with 0 threads
-    MultiThreadingMgr::instance().apply(false, 64);
-    // thread pool should be stopped
-    EXPECT_EQ(thread_pool.size(), 0);
+    MultiThreadingMgr::instance().apply(false, 0);
 }
 
 }  // namespace
index 168905e63632b9a352735bd6bd904a1a20e923e0..530c95fee5233b9f18abc541af6f332e553290d0 100644 (file)
@@ -66,22 +66,23 @@ public:
     /// @param enabled The new mode.
     void setMode(bool enabled);
 
-    /// @brief Increment override
+    /// @brief Increment override.
     ///
     /// When entering @ref MultiThreadingCriticalSection, increment override
     /// so that any configuration change that might start the packet thread pool
-    /// is delayed until exiting the respective section
+    /// is delayed until exiting the respective section.
     void incrementOverride();
 
-    /// @brief Decrement override
+    /// @brief Decrement override.
     ///
     /// When exiting @ref MultiThreadingCriticalSection, decrement override
-    /// so that the packet thread pool can be started according to configuration
+    /// so that the packet thread pool can be started according to the new
+    /// configuration.
     void decrementOverride();
 
-    /// @brief Get override
+    /// @brief Get override.
     ///
-    /// Get the override flag
+    /// Get the override flag.
     bool getOverride();
 
     /// @brief Get the packet thread pool.
@@ -106,7 +107,7 @@ public:
     /// @return The thread count.
     static uint32_t supportedThreadCount();
 
-    /// @brief Apply the multi-threading related settings
+    /// @brief Apply the multi-threading related settings.
     ///
     /// @param enabled The enabled flag: true if multi-threading is enabled,
     /// false otherwise.
@@ -131,7 +132,7 @@ private:
     ///
     /// In case the configuration is applied within a
     /// @ref MultiThreadingCriticalSection, the thread pool should not be
-    /// started until the section is over.
+    /// started until leaving the respective section.
     /// This also handles multiple interleaved sections.
     uint32_t override_;