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

dlerror *is* thread-safe on some platforms #42

Open
marioortizmanero opened this issue Oct 17, 2021 · 1 comment
Open

dlerror *is* thread-safe on some platforms #42

marioortizmanero opened this issue Oct 17, 2021 · 1 comment

Comments

@marioortizmanero
Copy link

I can see in the source code that there's a global lock for dlerror, since this crate assumes that it's not thread-safe. However, the manuals for Linux and macOS do indicate that their implementation is thread-safe:

Perhaps that lock could only be used on platforms other than these (or any more that might come up).

Also, the table about libloading not being thread-safe is slightly wrong, AFAIK (https://docs.rs/dlopen/0.1.8/dlopen/#compare-with-other-libraries). Internally, libloading uses SetThreadErrorMode (maybe it didn't in the past), which means that it's thread safe on Windows. The issue it has is that on FreeBSD, for example, dlerror isn't thread-safe.

@OpenByteDev
Copy link

I implemented this in my fork dlopen2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants