Register new snapshots
Also convert a number of `static mut` to just a plain old `static` and remove some unsafe blocks.
This commit is contained in:
@@ -230,11 +230,11 @@ pub mod dl {
|
||||
|
||||
pub fn check_for_errors_in<T>(f: || -> T) -> Result<T, String> {
|
||||
use rt::mutex::{StaticNativeMutex, NATIVE_MUTEX_INIT};
|
||||
static mut lock: StaticNativeMutex = NATIVE_MUTEX_INIT;
|
||||
static LOCK: StaticNativeMutex = NATIVE_MUTEX_INIT;
|
||||
unsafe {
|
||||
// dlerror isn't thread safe, so we need to lock around this entire
|
||||
// sequence
|
||||
let _guard = lock.lock();
|
||||
let _guard = LOCK.lock();
|
||||
let _old_error = dlerror();
|
||||
|
||||
let result = f();
|
||||
|
||||
Reference in New Issue
Block a user