From 420622b5a793186dfa533e7702913fd5e4764e0f Mon Sep 17 00:00:00 2001 From: Yuta Saito Date: Sun, 16 Jan 2022 00:37:54 +0900 Subject: [wasm] add no thread variant for freestanding environment This implementation does nothing around preemptive context switching because there is no native thread. --- include/ruby/thread_native.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/ruby/thread_native.h') diff --git a/include/ruby/thread_native.h b/include/ruby/thread_native.h index 2945ff1e4d..c23b15e133 100644 --- a/include/ruby/thread_native.h +++ b/include/ruby/thread_native.h @@ -37,6 +37,12 @@ typedef pthread_t rb_nativethread_id_t; typedef pthread_mutex_t rb_nativethread_lock_t; typedef pthread_cond_t rb_nativethread_cond_t; +#elif defined(__wasi__) // no-thread platforms + +typedef struct rb_nativethread_id_t *rb_nativethread_id_t; +typedef struct rb_nativethread_lock_t *rb_nativethread_lock_t; +typedef struct rb_nativethread_cond_t *rb_nativethread_cond_t; + #elif defined(__DOXYGEN__) /** Opaque type that holds an ID of a native thread. */ -- cgit v1.2.3