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
Fix crash libpd_openfile due to lock #178
Conversation
Thanks for checking this. Do we need both sys_lock and the globallock? I don't know, just checking. |
Yes because |
Adding a test is a good idea. I recently cleaned up the makefiles so they they should be easy to adapt. The plan in the future is to update libpd to use auto tools. |
Looks good. Let me know when you feel the PR is ready. I'm thinking we will also provide a libpd wrapper for |
I think it's ready for this PR. Sorry for the slowness :) |
If you use the current master branch, you could update the test to use the "libpd_*_instance" functions. Also, the main Makefile now has a "MULTI" build option so you no longer need to set PDINSTANCE and PDTHREADS in the test Makefile. Build libpd with multiple instance support via: |
Done ! Thanks |
It seems that
libpd_openfile()
needs to lock the global pd's mutex for writing otherwise becauseglob_evalfile()
uses static variable and if several instances call this function it crashes.