From cacc4160806ee5300dfeb3d6b1663bfbbbba5553 Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Wed, 8 Feb 2023 10:19:16 -0800 Subject: [PATCH] wasi-threads: fix import name (#5748) * wasi-threads: fix import name As @TerrorJack pointed out in #5484, that PR implements an older name--`thread_spawn`. This change uses the now-official name from the specification--`thread-spawn`. * fix: update name in test --- crates/wasi-threads/src/lib.rs | 2 +- tests/all/cli_tests/threads.wat | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/wasi-threads/src/lib.rs b/crates/wasi-threads/src/lib.rs index 9116e4508e..255d698b08 100644 --- a/crates/wasi-threads/src/lib.rs +++ b/crates/wasi-threads/src/lib.rs @@ -112,7 +112,7 @@ pub fn add_to_linker( ) -> anyhow::Result { linker.func_wrap( "wasi", - "thread_spawn", + "thread-spawn", move |mut caller: Caller<'_, T>, start_arg: i32| -> i32 { log::trace!("new thread requested via `wasi::thread_spawn` call"); let host = caller.data().clone(); diff --git a/tests/all/cli_tests/threads.wat b/tests/all/cli_tests/threads.wat index d935289738..3e5b4397b9 100644 --- a/tests/all/cli_tests/threads.wat +++ b/tests/all/cli_tests/threads.wat @@ -6,7 +6,7 @@ (func $__wasi_fd_write (param i32 i32 i32 i32) (result i32))) (import "wasi_snapshot_preview1" "proc_exit" (func $__wasi_proc_exit (param i32))) - (import "wasi" "thread_spawn" + (import "wasi" "thread-spawn" (func $__wasi_thread_spawn (param i32) (result i32))) (func (export "_start")