mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-15 17:41:45 +00:00
Add config plugin class.
This commit is contained in:
committed by
Dennis Klein
parent
bf8ec968e7
commit
cba6d19781
@@ -129,16 +129,11 @@ auto PluginServices::TakeDeviceControl(const std::string& controller) -> void
|
||||
{
|
||||
lock_guard<mutex> lock{fDeviceControllerMutex};
|
||||
|
||||
if (!fDeviceController)
|
||||
{
|
||||
if (!fDeviceController) {
|
||||
fDeviceController = controller;
|
||||
}
|
||||
else if (fDeviceController == controller)
|
||||
{
|
||||
} else if (fDeviceController == controller) {
|
||||
// nothing to do
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
throw DeviceControlError{tools::ToString(
|
||||
"Plugin '", controller, "' is not allowed to take over control. ",
|
||||
"Currently, plugin '", *fDeviceController, "' has taken control."
|
||||
@@ -158,12 +153,9 @@ auto PluginServices::ReleaseDeviceControl(const std::string& controller) -> void
|
||||
{
|
||||
lock_guard<mutex> lock{fDeviceControllerMutex};
|
||||
|
||||
if (fDeviceController == controller)
|
||||
{
|
||||
if (fDeviceController == controller) {
|
||||
fDeviceController = boost::none;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
throw DeviceControlError{tools::ToString("Plugin '", controller, "' cannot release control because it has not taken over control.")};
|
||||
}
|
||||
}
|
||||
@@ -182,8 +174,7 @@ auto PluginServices::WaitForReleaseDeviceControl() -> void
|
||||
{
|
||||
unique_lock<mutex> lock{fDeviceControllerMutex};
|
||||
|
||||
while (fDeviceController)
|
||||
{
|
||||
while (fDeviceController) {
|
||||
fReleaseDeviceControlCondition.wait(lock);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user