FairMQ: Move static and interactive control modes to plugin

NOT YET FINISHED
This commit is contained in:
Dennis Klein
2017-09-14 02:10:00 +02:00
committed by Mohammad Al-Turany
parent 2af3ae99eb
commit 10f67e4c72
9 changed files with 223 additions and 113 deletions

View File

@@ -89,9 +89,9 @@ const std::unordered_map<PluginServices::DeviceStateTransition, FairMQDevice::Ev
auto PluginServices::ChangeDeviceState(const std::string& controller, const DeviceStateTransition next) -> void
{
lock_guard<mutex> lock{fDeviceControllerMutex};
if(!fDeviceController) fDeviceController = controller;
// lock_guard<mutex> lock{fDeviceControllerMutex};
//
// if(!fDeviceController) fDeviceController = controller;
if(fDeviceController == controller)
{
@@ -159,5 +159,8 @@ auto PluginServices::WaitForReleaseDeviceControl() -> void
{
unique_lock<mutex> lock{fDeviceControllerMutex};
fReleaseDeviceControlCondition.wait(lock, [&]{ return !GetDeviceController(); });
while(GetDeviceController())
{
fReleaseDeviceControlCondition.wait(lock);
}
}