1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[wasm] add no thread variant for freestanding environment

This implementation does nothing around preemptive context switching
because there is no native thread.
This commit is contained in:
Yuta Saito 2022-01-16 00:37:54 +09:00
parent d6d52a7d04
commit 420622b5a7
Notes: git 2022-01-19 11:19:40 +09:00
5 changed files with 306 additions and 1 deletions

View file

@ -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. */