Fix deadlock issue

RawDevice would deadlock in some situations because I/O occured while
the listener was turning on. This also seems to have fixed logid
sometimes not detecting devices on receivers.
This commit is contained in:
pixl
2020-07-11 19:04:19 -04:00
parent 0fbeb1e3c9
commit de8e453bd3
4 changed files with 18 additions and 7 deletions

View File

@@ -200,9 +200,7 @@ uint16_t Device::pid() const
void Device::listen()
{
if(!_raw_device->isListening())
thread::spawn({[raw=this->_raw_device]() {
raw->listen();
}});
_raw_device->listenAsync();
// Pass all HID++ events with device index to this device.
auto handler = std::make_shared<raw::RawEventHandler>();