void
MultiThreadingMgr::enterCriticalSection() {
+ stopPktProcessing();
++critical_section_count_;
}
isc_throw(InvalidOperation, "invalid negative value for override");
}
--critical_section_count_;
+ startPktProcessing();
}
bool
}
MultiThreadingCriticalSection::MultiThreadingCriticalSection() {
- MultiThreadingMgr::instance().stopPktProcessing();
MultiThreadingMgr::instance().enterCriticalSection();
}
MultiThreadingCriticalSection::~MultiThreadingCriticalSection() {
MultiThreadingMgr::instance().exitCriticalSection();
- MultiThreadingMgr::instance().startPktProcessing();
}
} // namespace util
/// configured, 0 if auto scaling is desired
void apply(bool enabled, uint32_t thread_count);
- /// @brief Class method stopping and joining all threads of the pool.
- ///
- /// Stop the packet thread pool if running.
- void stopPktProcessing();
-
- /// @brief Class method (re)starting threads of the pool.
- ///
- /// Start the packet thread pool according to current configuration.
- void startPktProcessing();
-
protected:
/// @brief Constructor.
private:
+ /// @brief Class method stopping and joining all threads of the pool.
+ ///
+ /// Stop the packet thread pool if running.
+ void stopPktProcessing();
+
+ /// @brief Class method (re)starting threads of the pool.
+ ///
+ /// Start the packet thread pool according to current configuration.
+ void startPktProcessing();
+
/// @brief The current multi-threading mode.
///
/// The multi-threading flag: true if multi-threading is enabled, false