diff --git a/src/os/unix/mod.rs b/src/os/unix/mod.rs index b06e716..16a5ac6 100644 --- a/src/os/unix/mod.rs +++ b/src/os/unix/mod.rs @@ -55,6 +55,8 @@ pub struct Library { handle: *mut raw::c_void } +unsafe impl ::std::marker::Send for Library {} + impl Library { fn open

(filename: Option

, flags: raw::c_int) -> ::Result where P: AsRef { diff --git a/src/os/windows/mod.rs b/src/os/windows/mod.rs index f99157c..5c882e4 100644 --- a/src/os/windows/mod.rs +++ b/src/os/windows/mod.rs @@ -15,6 +15,10 @@ use std::sync::atomic::{AtomicBool, ATOMIC_BOOL_INIT, Ordering}; /// A platform-specific equivalent of the cross-platform `Library`. pub struct Library(winapi::HMODULE); +// There’s little documentation on Send-ability of HMODULE, but lack of warnings on the MSDN page +// and reading http://stackoverflow.com/a/11254061, it seems like it should be fine? +unsafe impl ::std::marker::Send for Library {} + impl Library { /// Find and load a shared library (module). ///