-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
auto merge of #9713 : sfackler/rust/dynamic_lib, r=alexcrichton
The root issue is that dlerror isn't reentrant or even thread safe. The solution implemented here is to make a yielding spin lock over an AtomicFlag. This is pretty hacky, but the best we can do at this point. As far as I can tell, it isn't possible to create a global mutex without having to initialize it in a single threaded context. The Windows code isn't affected since errno is thread-local on Windows and it's running in an atomically block to ensure there isn't a green thread context switch. Closes #8156
- Loading branch information
Showing
3 changed files
with
33 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -206,3 +206,5 @@ sd_markdown_render | |
sd_markdown_free | ||
bufrelease | ||
bufnew | ||
rust_take_dlerror_lock | ||
rust_drop_dlerror_lock |