From 3949d920e86d52f4d6cd614380ccc6b862dfe004 Mon Sep 17 00:00:00 2001 From: fzyzcjy <5236035+fzyzcjy@users.noreply.github.com> Date: Wed, 6 Dec 2023 14:02:15 +0800 Subject: [PATCH] Update lib.rs --- src/lib.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index f38d6a3e2c4..021d8ee930a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -481,6 +481,16 @@ impl JsValue { } } +/// The JsValue type wraps a slab/heap of js objects which is managed by +/// the wasm-bindgen shim, and everything here is not actually able to cross +/// any thread boundaries. When wasm actually has threads, for example, each +/// thread will have to have its own slab of objects generated by +/// wasm-bindgen, and indices in one slab aren't valid in any other slabs. +impl !Send for JsValue {} + +/// Please refer to `!Send` for documentation. +impl !Sync for JsValue {} + impl PartialEq for JsValue { /// Compares two `JsValue`s for equality, using the `===` operator in JS. ///