Closed sgjava closed 6 years ago
That's interesting, I'm curious if it's not something related to the Global Interpreter Lock in python. I'll take a look.
Seems like I will need to use Py_BEGIN_ALLOW_THREADS and Py_END_ALLOW_THREADS before and after the internal call to gpiod_line_event_wait() respectively.
Let me know when you commit changes and I'll test, thanks.
@sgjava I don't really have time to test it today, but I pushed a fix to topic/python-locking branch that should theoretically fix it. I should probably add these macros around all blocking operations in the module. Let me know if you can test it and if it works.
I just tested event_wait and it works as expected in a thread. Let me know when you commit changes to master. I'll finish up converting the rest of my example code to the new bindings.
Done.
I just built and tested my threading example. Looks good, thanks.
Code I have using CFFI/Python 3 and libgpiod 1.0 line.event_wait worked fine in a thread. Using your new Python bindings this code hangs main program until timeout or event fires.