Skip to content
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

capi: make thread-safe #23

Closed
cyphar opened this issue Jan 23, 2020 · 2 comments
Closed

capi: make thread-safe #23

cyphar opened this issue Jan 23, 2020 · 2 comments
Labels
api/cffi Related to the C-FFI API.

Comments

@cyphar
Copy link
Member

cyphar commented Jan 23, 2020

One of the things which was pointed out during the review of #22 is that libpathrs's C API appears to be fundamentally thread-unsafe. So we need to Arc<Mutex<...>> the whole thing, as well as having per-thread errors.

@cyphar cyphar added the api/cffi Related to the C-FFI API. label Jan 23, 2020
@cyphar
Copy link
Member Author

cyphar commented Jan 23, 2020

While not the prettiest thing in the world, daa9a6a should fix the issue. This will require making the Go binding lock itself to the right OS thread during each operation...

@cyphar
Copy link
Member Author

cyphar commented Jan 23, 2020

And a52049c fixes the thread-safety for the Go bindings.

@cyphar cyphar closed this as completed Jan 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api/cffi Related to the C-FFI API.
Projects
None yet
Development

No branches or pull requests

1 participant