HA+MT Hook libs need a way to honor or/be notified of CriticalSection entry/exit
When Kea core needs to do critical work, it enters a critical section, (see util::MultiThreadingCriticalSection). Currently this causes DHCP threads to be destroyed, thus eliminating contention for critical resources that need to be manipulated, and the threads are recreated upon critical section exit. MT hooks need the opportunity to stop/pause and start/resume in-step with this to avoid train wrecks. One notion that @razvan and I discussed was having a way to register critical section entry/exit callbacks with core. These would be invoked as critical sections are entered and exited.
As @razvan described "...most things are related to having http client/listener threads running while entering CS (mostly while other commands are run: lease updates/config-reload/config-set/config-test)."
I am breaking this down into at least two MRs:
- Make it possible to pause/resume thread-pools in HttpClient and CmdHttpListener
- Add Critical section entry/exit callbacks and integrate their use into HA