File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -473,6 +473,13 @@ fn populate_with_wasi(
473473 #[ cfg( feature = "wasi-crypto" ) ]
474474 {
475475 wasmtime_wasi_crypto:: add_to_linker ( linker, |host| {
476+ // This WASI proposal is currently not protected against
477+ // concurrent access--i.e., when wasi-threads is actively
478+ // spawning new threads, we cannot (yet) safely allow access and
479+ // fail if more than one thread has `Arc`-references to the
480+ // context. Once this proposal is updated (as wasi-common has
481+ // been) to allow concurrent access, this `Arc::get_mut`
482+ // limitation can be removed.
476483 Arc :: get_mut ( host. wasi_crypto . as_mut ( ) . unwrap ( ) )
477484 . expect ( "wasi-crypto is not implemented with multi-threading support" )
478485 } ) ?;
@@ -488,6 +495,7 @@ fn populate_with_wasi(
488495 #[ cfg( feature = "wasi-nn" ) ]
489496 {
490497 wasmtime_wasi_nn:: add_to_linker ( linker, |host| {
498+ // See documentation for wasi-crypto for why this is needed.
491499 Arc :: get_mut ( host. wasi_nn . as_mut ( ) . unwrap ( ) )
492500 . expect ( "wasi-nn is not implemented with multi-threading support" )
493501 } ) ?;
You can’t perform that action at this time.
0 commit comments