From f5a0bd223b2194203aa7435ac09fc73468544a46 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sun, 26 Feb 2023 14:05:26 -0700 Subject: [PATCH] [wasm-shape] Comment re thread-safety --- src/hb-wasm-shape.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/hb-wasm-shape.cc b/src/hb-wasm-shape.cc index 25b35cbcc..30c0d193f 100644 --- a/src/hb-wasm-shape.cc +++ b/src/hb-wasm-shape.cc @@ -120,8 +120,12 @@ _hb_wasm_init () * It's clunky that we can't allocate a static mutex. * So we have to first allocate one on the heap atomically... * + * Do we also need to lock around module creation? + * * Also, wasm-micro-runtime uses a singleton instance. So if - * another library or client uses it, all bets are off. :-( */ + * another library or client uses it, all bets are off. :-( + * If nothing else, around HB_REF2OBJ(). + */ static bool initialized; if (initialized)