diff --git a/protocol/esta/dmx/universe.cpp b/protocol/esta/dmx/universe.cpp index 5963d6a..683caa2 100644 --- a/protocol/esta/dmx/universe.cpp +++ b/protocol/esta/dmx/universe.cpp @@ -295,7 +295,6 @@ void Universe::rx_timeout_(bool add_now) */ void Universe::do_callbacks_(std::vector>> & callbacks) { - std::shared_lock lk_ctl(mtx_control); for (auto it = callbacks.cbegin(); it != callbacks.cend();) { if (auto sp = it->lock()) @@ -305,11 +304,8 @@ void Universe::do_callbacks_(std::vector ArbitratingUniverse::onSourceListChange(std::functionlock()) @@ -202,12 +201,8 @@ void ArbitratingUniverse::doListChangeCallbacks() } else { // or remove the callback - - lk_ctl.unlock(); // release the shared lock - mtx_control.lock(); // take a unique lock + std::unique_lock lk_ctl(mtx_control); it = cb_sourceListChange.erase(it); - mtx_control.unlock(); // release the unique lock - lk_ctl.lock(); // retake the shared lock } } }