mirror of
https://github.com/openharmony/third_party_rust_libloading.git
synced 2026-07-21 00:26:36 -04:00
Make Library Send
This commit is contained in:
@@ -55,6 +55,8 @@ pub struct Library {
|
||||
handle: *mut raw::c_void
|
||||
}
|
||||
|
||||
unsafe impl ::std::marker::Send for Library {}
|
||||
|
||||
impl Library {
|
||||
fn open<P>(filename: Option<P>, flags: raw::c_int) -> ::Result<Library>
|
||||
where P: AsRef<OsStr> {
|
||||
|
||||
@@ -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).
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user