summaryrefslogtreecommitdiffstats
path: root/src/lib/config
diff options
context:
space:
mode:
authorRazvan Becheriu <razvan@isc.org>2021-08-24 20:50:30 +0200
committerRazvan Becheriu <razvan@isc.org>2021-08-24 20:52:09 +0200
commitb9ce41af4bb76df60f705922a9755f4b763f211e (patch)
treefd8442874871ef290ad564d5eef8f2454c7dade1 /src/lib/config
parent[#2043] fixed compilation (diff)
downloadkea-b9ce41af4bb76df60f705922a9755f4b763f211e.tar.xz
kea-b9ce41af4bb76df60f705922a9755f4b763f211e.zip
[#2043] add check permissions for current thread action on thread pools
Diffstat (limited to 'src/lib/config')
-rw-r--r--src/lib/config/cmd_http_listener.cc7
-rw-r--r--src/lib/config/cmd_http_listener.h7
2 files changed, 14 insertions, 0 deletions
diff --git a/src/lib/config/cmd_http_listener.cc b/src/lib/config/cmd_http_listener.cc
index 7063e17b4e..36c3678219 100644
--- a/src/lib/config/cmd_http_listener.cc
+++ b/src/lib/config/cmd_http_listener.cc
@@ -83,6 +83,13 @@ CmdHttpListener::start() {
}
void
+CmdHttpListener::checkPermissions() {
+ if (thread_pool_) {
+ thread_pool_->checkPausePermissions();
+ }
+}
+
+void
CmdHttpListener::pause() {
if (thread_pool_) {
thread_pool_->pause();
diff --git a/src/lib/config/cmd_http_listener.h b/src/lib/config/cmd_http_listener.h
index 4b1f414218..bc59d214d5 100644
--- a/src/lib/config/cmd_http_listener.h
+++ b/src/lib/config/cmd_http_listener.h
@@ -38,6 +38,13 @@ public:
/// @brief Destructor
virtual ~CmdHttpListener();
+ /// @brief Check if the current thread can perform thread pool state
+ /// transition.
+ ///
+ /// @throw MultiThreadingInvalidOperation if the state transition is done on
+ /// any of the owned threads
+ void checkPermissions();
+
/// @brief Starts running the listener's thread pool.
void start();