multi_threading_mgr.cc 1.03 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11
// Copyright (C) 2019 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

#include <util/multi_threading_mgr.h>

namespace isc {
namespace util {

12
MultiThreadingMgr::MultiThreadingMgr() : enabled_(false) {
13 14
}

15 16 17 18 19 20 21
MultiThreadingMgr::~MultiThreadingMgr() {
}

MultiThreadingMgr&
MultiThreadingMgr::instance() {
    static MultiThreadingMgr manager;
    return (manager);
22 23 24
}

bool
25
MultiThreadingMgr::getMode() const {
26 27 28 29
    return (enabled_);
}

void
30
MultiThreadingMgr::setMode(bool enabled) {
31 32 33
    enabled_ = enabled;
}

Razvan Becheriu's avatar
Razvan Becheriu committed
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
ThreadPool<std::function<void()>>&
MultiThreadingMgr::getPktThreadPool() {
    return pkt_thread_pool_;
}

uint32_t
MultiThreadingMgr::getPktThreadPoolSize() const {
    return (pkt_thread_pool_size_);
}

void
MultiThreadingMgr::setPktThreadPoolSize(uint32_t size) {
    pkt_thread_pool_size_ = size;
}

}  // namespace util
}  // namespace isc