File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ use std::{
2424 marker:: PhantomData ,
2525 mem:: { self , ManuallyDrop , MaybeUninit } ,
2626 ptr:: NonNull ,
27- rc :: Rc ,
27+ cell :: Cell
2828} ;
2929
3030#[ cfg( feature = "net8_0" ) ]
@@ -85,9 +85,11 @@ pub struct HostfxrContext<I> {
8585 is_primary : bool ,
8686 runtime_delegates : EnumMap < hostfxr_delegate_type , OnceCell < RawFunctionPtr > > ,
8787 context_type : PhantomData < I > ,
88- not_thread_safe : PhantomData < Rc < HostfxrLibrary > > ,
88+ not_sync : PhantomData < Cell < HostfxrLibrary > >
8989}
9090
91+ unsafe impl < I > Send for HostfxrContext < I > { }
92+
9193impl < I > Debug for HostfxrContext < I > {
9294 fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
9395 f. debug_struct ( "HostfxrContext" )
@@ -117,7 +119,7 @@ impl<I> HostfxrContext<I> {
117119 is_primary,
118120 runtime_delegates : EnumMap :: default ( ) ,
119121 context_type : PhantomData ,
120- not_thread_safe : PhantomData ,
122+ not_sync : PhantomData ,
121123 }
122124 }
123125
Original file line number Diff line number Diff line change @@ -9,11 +9,11 @@ use std::{
99 env:: consts:: EXE_SUFFIX ,
1010 ffi:: OsString ,
1111 path:: { Path , PathBuf } ,
12- rc :: Rc ,
12+ sync :: Arc ,
1313} ;
1414
1515pub ( crate ) type HostfxrLibrary = Container < crate :: bindings:: hostfxr:: wrapper_option:: Hostfxr > ;
16- pub ( crate ) type SharedHostfxrLibrary = Rc < HostfxrLibrary > ;
16+ pub ( crate ) type SharedHostfxrLibrary = Arc < HostfxrLibrary > ;
1717#[ allow( clippy:: cast_possible_wrap) ]
1818pub ( crate ) const UNSUPPORTED_HOST_VERSION_ERROR_CODE : i32 =
1919 HostingError :: HostApiUnsupportedVersion . value ( ) as i32 ;
You can’t perform that action at this time.
0 commit comments