summaryrefslogtreecommitdiff
path: root/include/ruby
diff options
context:
space:
mode:
authorYuta Saito <kateinoigakukun@gmail.com>2022-01-16 00:37:54 +0900
committerYuta Saito <kateinoigakukun@gmail.com>2022-01-19 11:19:06 +0900
commit420622b5a793186dfa533e7702913fd5e4764e0f (patch)
tree3b56e4ef9ff26891aaa92aadd9ee9561ef50d76e /include/ruby
parentd6d52a7d049fd802b37d0f594629bad2cdc6b8c2 (diff)
[wasm] add no thread variant for freestanding environment
This implementation does nothing around preemptive context switching because there is no native thread.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/5407
Diffstat (limited to 'include/ruby')
-rw-r--r--include/ruby/thread_native.h6
1 files changed, 6 insertions, 0 deletions
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. */