Skip to content

Commit

Permalink
Fix #33
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Braunsperger committed Feb 2, 2024
1 parent b6348be commit c07fbf1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions src/hostfxr/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use std::{
marker::PhantomData,
mem::{self, ManuallyDrop, MaybeUninit},
ptr::NonNull,
rc::Rc,
cell::Cell
};

#[cfg(feature = "net8_0")]
Expand Down Expand Up @@ -85,9 +85,11 @@ pub struct HostfxrContext<I> {
is_primary: bool,
runtime_delegates: EnumMap<hostfxr_delegate_type, OnceCell<RawFunctionPtr>>,
context_type: PhantomData<I>,
not_thread_safe: PhantomData<Rc<HostfxrLibrary>>,
not_sync: PhantomData<Cell<HostfxrLibrary>>
}

unsafe impl<I> Send for HostfxrContext<I> {}

impl<I> Debug for HostfxrContext<I> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("HostfxrContext")
Expand Down Expand Up @@ -117,7 +119,7 @@ impl<I> HostfxrContext<I> {
is_primary,
runtime_delegates: EnumMap::default(),
context_type: PhantomData,
not_thread_safe: PhantomData,
not_sync: PhantomData,
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/hostfxr/library.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ use std::{
env::consts::EXE_SUFFIX,
ffi::OsString,
path::{Path, PathBuf},
rc::Rc,
sync::Arc,
};

pub(crate) type HostfxrLibrary = Container<crate::bindings::hostfxr::wrapper_option::Hostfxr>;
pub(crate) type SharedHostfxrLibrary = Rc<HostfxrLibrary>;
pub(crate) type SharedHostfxrLibrary = Arc<HostfxrLibrary>;
#[allow(clippy::cast_possible_wrap)]
pub(crate) const UNSUPPORTED_HOST_VERSION_ERROR_CODE: i32 =
HostingError::HostApiUnsupportedVersion.value() as i32;
Expand Down

0 comments on commit c07fbf1

Please sign in to comment.