Fix race condition in the control plugin

This commit is contained in:
Alexey Rybalchenko 2018-09-12 12:29:51 +02:00 committed by Dennis Klein
parent 9bab3f9f4c
commit e642262468
No known key found for this signature in database
GPG Key ID: 08E62D23FA0ECBBC

View File

@ -227,7 +227,7 @@ auto Control::WaitForNextState() -> DeviceState
unique_lock<mutex> lock{fEventsMutex};
while (fEvents.empty())
{
fNewEvent.wait(lock);
fNewEvent.wait_for(lock, chrono::milliseconds(50));
}
auto result = fEvents.front();