diff options
Diffstat (limited to 'lib/std/Thread.zig')
| -rw-r--r-- | lib/std/Thread.zig | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/std/Thread.zig b/lib/std/Thread.zig index b8cc8c8869..99e2feb4cf 100644 --- a/lib/std/Thread.zig +++ b/lib/std/Thread.zig @@ -919,6 +919,10 @@ const WasiThreadImpl = struct { /// Bootstrap procedure, called by the host environment after thread creation. export fn wasi_thread_start(tid: i32, arg: *Instance) void { + if (builtin.single_threaded) { + // ensure function is not analyzed in single-threaded mode + return; + } __set_stack_pointer(arg.thread.memory.ptr + arg.stack_offset); __wasm_init_tls(arg.thread.memory.ptr + arg.tls_offset); @atomicStore(u32, &WasiThreadImpl.tls_thread_id, @intCast(tid), .SeqCst); |
