diff --git a/system/include/emscripten/val.h b/system/include/emscripten/val.h index 197d8e8866302..dfb3e7e7c2b53 100644 --- a/system/include/emscripten/val.h +++ b/system/include/emscripten/val.h @@ -388,7 +388,7 @@ class EMBIND_VISIBILITY_DEFAULT val { } EM_VAL as_handle() const { -#ifdef _REENTRANT +#ifdef __EMSCRIPTEN_PTHREADS__ assert(pthread_equal(thread, pthread_self()) && "val accessed from wrong thread"); #endif return handle; @@ -568,7 +568,7 @@ class EMBIND_VISIBILITY_DEFAULT val { private: // takes ownership, assumes handle already incref'd and lives on the same thread explicit val(EM_VAL handle) : -#ifdef _REENTRANT +#ifdef __EMSCRIPTEN_PTHREADS__ thread(pthread_self()), #endif handle(handle) {}