diff --git a/src/lib/dhcpsrv/multi_threading_utils.h b/src/lib/dhcpsrv/multi_threading_utils.h index 533a7f84ca..63faee7898 100644 --- a/src/lib/dhcpsrv/multi_threading_utils.h +++ b/src/lib/dhcpsrv/multi_threading_utils.h @@ -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: diff --git a/src/lib/dhcpsrv/tests/multi_threading_utils_unittest.cc b/src/lib/dhcpsrv/tests/multi_threading_utils_unittest.cc index 10c28b57af..c97b576910 100644 --- a/src/lib/dhcpsrv/tests/multi_threading_utils_unittest.cc +++ b/src/lib/dhcpsrv/tests/multi_threading_utils_unittest.cc @@ -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 diff --git a/src/lib/util/multi_threading_mgr.h b/src/lib/util/multi_threading_mgr.h index 168905e636..530c95fee5 100644 --- a/src/lib/util/multi_threading_mgr.h +++ b/src/lib/util/multi_threading_mgr.h @@ -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_;