diff options
author | Yuta Saito <kateinoigakukun@gmail.com> | 2022-01-16 00:37:54 +0900 |
---|---|---|
committer | Yuta Saito <kateinoigakukun@gmail.com> | 2022-01-19 11:19:06 +0900 |
commit | 420622b5a793186dfa533e7702913fd5e4764e0f (patch) | |
tree | 3b56e4ef9ff26891aaa92aadd9ee9561ef50d76e /include | |
parent | d6d52a7d049fd802b37d0f594629bad2cdc6b8c2 (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')
-rw-r--r-- | include/ruby/thread_native.h | 6 |
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. */ |