"is not yet implemented");
}
-MultiThreadingCriticalSection::MultiThreadingCriticalSection()
- : enabled_(MultiThreadingMgr::instance().getMode()) {
- if (enabled_) {
+MultiThreadingCriticalSection::MultiThreadingCriticalSection() {
+ if (MultiThreadingMgr::instance().getMode()) {
stopPktProcessing();
}
}
MultiThreadingCriticalSection::~MultiThreadingCriticalSection() {
- if (enabled_) {
+ if (MultiThreadingMgr::instance().getMode()) {
startPktProcessing();
}
}
namespace isc {
namespace dhcp {
-/// @note: everything here MUST be used only from the main thread.
+/// @note: everything here MUST be used ONLY from the main thread.
/// When called from a thread of the pool it can deadlock.
/// @brief Function stopping and joining all threads of the pool.
void startPktProcessing();
/// @brief RAII class creating a critical section.
+///
+/// @note: the multi-threading mode MUST NOT be changed in the RAII
+/// @c MultiThreadingCriticalSection body.
class MultiThreadingCriticalSection : public boost::noncopyable {
public:
/// @brief Constructor.
/// @brief Class method (re)starting threads of the pool.
/// @throw isc::NotImplemented until is implemented.
static void startPktProcessing();
-
-private:
- /// @brief Local copy of the multi-threading mode.
- bool enabled_;
};
}