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 @@ -472,6 +472,13 @@ fn populate_with_wasi(
472472 #[ cfg( feature = "wasi-crypto" ) ]
473473 {
474474 wasmtime_wasi_crypto:: add_to_linker ( linker, |host| {
475+ // This WASI proposal is currently not protected against
476+ // concurrent access--i.e., when wasi-threads is actively
477+ // spawning new threads, we cannot (yet) safely allow access and
478+ // fail if more than one thread has `Arc`-references to the
479+ // context. Once this proposal is updated (as wasi-common has
480+ // been) to allow concurrent access, this `Arc::get_mut`
481+ // limitation can be removed.
475482 Arc :: get_mut ( host. wasi_crypto . as_mut ( ) . unwrap ( ) )
476483 . expect ( "wasi-crypto is not implemented with multi-threading support" )
477484 } ) ?;
@@ -487,6 +494,7 @@ fn populate_with_wasi(
487494 #[ cfg( feature = "wasi-nn" ) ]
488495 {
489496 wasmtime_wasi_nn:: add_to_linker ( linker, |host| {
497+ // See documentation for wasi-crypto for why this is needed.
490498 Arc :: get_mut ( host. wasi_nn . as_mut ( ) . unwrap ( ) )
491499 . expect ( "wasi-nn is not implemented with multi-threading support" )
492500 } ) ?;
You can’t perform that action at this time.
0 commit comments