]> git.lizzy.rs Git - rust.git/commitdiff
auto merge of #9713 : sfackler/rust/dynamic_lib, r=alexcrichton
authorbors <bors@rust-lang.org>
Sat, 5 Oct 2013 22:41:35 +0000 (15:41 -0700)
committerbors <bors@rust-lang.org>
Sat, 5 Oct 2013 22:41:35 +0000 (15:41 -0700)
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


Trivial merge