If the user's callback functions throw an exception, the shared read-lock will never unlock, and create a deadlock if the callbacks are attempted to be updated afterwords. This is easily solved with C++14's std::shared_lock wrapper that uses RAII to automatically call unlock_shared when it goes out of scope.
If the user's callback functions throw an exception, the shared read-lock will never unlock, and create a deadlock if the callbacks are attempted to be updated afterwords. This is easily solved with C++14's
std::shared_lock
wrapper that uses RAII to automatically callunlock_shared
when it goes out of scope.