-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
closing serial port causes close eventloop and shutdown #172
Comments
Will take a look. |
any progess on this ? |
Apologies - not a simple fix - the current implementation settled on a blocking read to replicate behaviour similar to Java I/O. I added the SIGINT to interrupt any remaining blocking reads but clearly didn't fully think through the implications. I suspect I will need to switch to an event based read model under the hood to maintain the same exposed API in SerialDevice which will be a bit more complicated. |
I have several gpio listeners
when call serial.close() gpio listeners are closed
INFO com.diozero.internal.provider.builtin.gpio.GpioChip::eventLoop - Event loop finished
probably by this :
raise(SIGINT);
in native utils
https://github.com/mattjlewis/diozero/blob/main/system-utils-native/src/main/c/com_diozero_internal_provider_builtin_serial_NativeSerialDevice.c#L381
having serial port open all time causes 100% cpu utilisation.
The text was updated successfully, but these errors were encountered: