-
Notifications
You must be signed in to change notification settings - Fork 106
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
Calling line.event_wait in thread hangs main program #26
Comments
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.
The text was updated successfully, but these errors were encountered: