File tree Expand file tree Collapse file tree 6 files changed +155
-2
lines changed
expected/wasm32-wasi/posix
libc-top-half/musl/src/thread Expand file tree Collapse file tree 6 files changed +155
-2
lines changed Original file line number Diff line number Diff line change @@ -203,6 +203,7 @@ LIBC_TOP_HALF_MUSL_SOURCES += \
203
203
thread/pthread_condattr_init.c \
204
204
thread/pthread_condattr_setclock.c \
205
205
thread/pthread_condattr_setpshared.c \
206
+ thread/pthread_create.c \
206
207
thread/pthread_mutex_consistent.c \
207
208
thread/pthread_mutex_destroy.c \
208
209
thread/pthread_mutex_init.c \
@@ -229,6 +230,7 @@ LIBC_TOP_HALF_MUSL_SOURCES += \
229
230
thread/pthread_rwlockattr_destroy.c \
230
231
thread/pthread_rwlockattr_init.c \
231
232
thread/pthread_rwlockattr_setpshared.c \
233
+ thread/pthread_setcancelstate.c \
232
234
thread/pthread_testcancel.c \
233
235
thread/sem_destroy.c \
234
236
thread/sem_getvalue.c \
@@ -237,7 +239,6 @@ LIBC_TOP_HALF_MUSL_SOURCES += \
237
239
thread/sem_timedwait.c \
238
240
thread/sem_trywait.c \
239
241
thread/sem_wait.c \
240
- thread/pthread_setcancelstate.c \
241
242
)
242
243
endif
243
244
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ __EINVAL
11
11
__ENOMEM
12
12
__SIG_ERR
13
13
__SIG_IGN
14
+ __acquire_ptc
14
15
__aio_close
15
16
__asctime_r
16
17
__assert_fail
@@ -41,6 +42,7 @@ __des_setkey
41
42
__do_cleanup_pop
42
43
__do_cleanup_push
43
44
__do_des
45
+ __do_orphaned_stdio_locks
44
46
__duplocale
45
47
__env_rm_add
46
48
__exp2f_data
@@ -182,6 +184,8 @@ __private_cond_signal
182
184
__progname
183
185
__progname_full
184
186
__pthread_cond_timedwait
187
+ __pthread_create
188
+ __pthread_exit
185
189
__pthread_mutex_lock
186
190
__pthread_mutex_timedlock
187
191
__pthread_mutex_trylock
@@ -196,11 +200,15 @@ __pthread_rwlock_unlock
196
200
__pthread_rwlock_wrlock
197
201
__pthread_setcancelstate
198
202
__pthread_testcancel
203
+ __pthread_tsd_main
204
+ __pthread_tsd_run_dtors
205
+ __pthread_tsd_size
199
206
__putenv
200
207
__qsort_r
201
208
__rand48_step
202
209
__random_lockptr
203
210
__reallocarray
211
+ __release_ptc
204
212
__rem_pio2
205
213
__rem_pio2_large
206
214
__rem_pio2f
@@ -257,6 +265,9 @@ __tanl
257
265
__testcancel
258
266
__timedwait
259
267
__timedwait_cp
268
+ __tl_lock
269
+ __tl_sync
270
+ __tl_unlock
260
271
__tm_to_secs
261
272
__tm_to_tzname
262
273
__tolower_l
@@ -322,6 +333,7 @@ __wasi_sock_accept
322
333
__wasi_sock_recv
323
334
__wasi_sock_send
324
335
__wasi_sock_shutdown
336
+ __wasi_thread_spawn
325
337
__wasilibc_access
326
338
__wasilibc_cwd
327
339
__wasilibc_cwd_lock
@@ -948,6 +960,8 @@ pthread_condattr_destroy
948
960
pthread_condattr_init
949
961
pthread_condattr_setclock
950
962
pthread_condattr_setpshared
963
+ pthread_create
964
+ pthread_exit
951
965
pthread_mutex_consistent
952
966
pthread_mutex_destroy
953
967
pthread_mutex_getprioceiling
@@ -1212,6 +1226,7 @@ vswprintf
1212
1226
vswscanf
1213
1227
vwprintf
1214
1228
vwscanf
1229
+ wasi_thread_start
1215
1230
wcpcpy
1216
1231
wcpncpy
1217
1232
wcrtomb
Original file line number Diff line number Diff line change 1
1
__addtf3
2
+ __copy_tls
3
+ __default_guardsize
4
+ __default_stacksize
2
5
__divtf3
3
6
__eqtf2
4
7
__extenddftf2
@@ -56,6 +59,7 @@ __imported_wasi_snapshot_preview1_sock_accept
56
59
__imported_wasi_snapshot_preview1_sock_recv
57
60
__imported_wasi_snapshot_preview1_sock_send
58
61
__imported_wasi_snapshot_preview1_sock_shutdown
62
+ __imported_wasi_snapshot_preview2_thread_spawn
59
63
__letf2
60
64
__lock
61
65
__lockfile
@@ -64,6 +68,7 @@ __main_argc_argv
64
68
__netf2
65
69
__stack_pointer
66
70
__subtf3
71
+ __thread_list_lock
67
72
__tls_base
68
73
__trunctfdf2
69
74
__trunctfsf2
Original file line number Diff line number Diff line change @@ -2089,6 +2089,25 @@ __wasi_errno_t __wasi_sock_shutdown(
2089
2089
) __attribute__((__warn_unused_result__ ));
2090
2090
/** @} */
2091
2091
2092
+ #ifdef _REENTRANT
2093
+ /**
2094
+ * Request a new thread to be created by the host.
2095
+ *
2096
+ * The host will create a new instance of the current module sharing its
2097
+ * memory, find an exported entry function--`wasi_thread_start`--, and call the
2098
+ * entry function with `start_arg` in the new thread.
2099
+ *
2100
+ * @see https://github.com/WebAssembly/wasi-threads/#readme
2101
+ */
2102
+ __wasi_errno_t __wasi_thread_spawn (
2103
+ /**
2104
+ * A pointer to an opaque struct to be passed to the module's entry
2105
+ * function.
2106
+ */
2107
+ void * start_arg
2108
+ ) __attribute__((__warn_unused_result__ ));
2109
+ #endif
2110
+
2092
2111
#ifdef __cplusplus
2093
2112
}
2094
2113
#endif
Original file line number Diff line number Diff line change @@ -659,3 +659,14 @@ __wasi_errno_t __wasi_sock_shutdown(
659
659
return (uint16_t ) ret ;
660
660
}
661
661
662
+ #ifdef _REENTRANT
663
+ int32_t __imported_wasi_snapshot_preview2_thread_spawn (int32_t arg0 ) __attribute__((
664
+ __import_module__ ("wasi_snapshot_preview2" ),
665
+ __import_name__ ("thread_spawn" )
666
+ ));
667
+
668
+ __wasi_errno_t __wasi_thread_spawn (void * start_arg ) {
669
+ int32_t ret = __imported_wasi_snapshot_preview2_thread_spawn ((int32_t ) start_arg );
670
+ return (uint16_t ) ret ;
671
+ }
672
+ #endif
You can’t perform that action at this time.
0 commit comments