Skip to content

Commit fb31bcc

Browse files
yamtjohn-sharratt
authored andcommitted
WASIX has thread exit
1 parent 97e6dc2 commit fb31bcc

File tree

4 files changed

+4
-7
lines changed

4 files changed

+4
-7
lines changed

expected/wasm32-wasi-pthread/defined-symbols.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,6 @@ __progname
229229
__progname_full
230230
__pthread_cond_timedwait
231231
__pthread_create
232-
__pthread_exit
233232
__pthread_join
234233
__pthread_key_create
235234
__pthread_key_delete

libc-top-half/musl/src/include/pthread.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ hidden int __pthread_once(pthread_once_t *, void (*)(void));
77
hidden void __pthread_testcancel(void);
88
hidden int __pthread_setcancelstate(int, int *);
99
hidden int __pthread_create(pthread_t *restrict, const pthread_attr_t *restrict, void *(*)(void *), void *restrict);
10-
hidden _Noreturn void __pthread_exit(void *);
10+
hidden void __pthread_exit(void *);
1111
hidden int __pthread_join(pthread_t, void **);
1212
hidden int __pthread_mutex_lock(pthread_mutex_t *);
1313
hidden int __pthread_mutex_trylock(pthread_mutex_t *);

libc-top-half/musl/src/thread/pthread_create.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,7 @@ _Noreturn void __pthread_exit(void *result)
192192
// do it manually here
193193
__tl_unlock();
194194
free(self->map_base);
195-
// Can't use `exit()` here, because it is too high level
196-
for (;;) __wasi_proc_exit(0);
195+
for (;;) __wasi_thread_exit(0);
197196
}
198197
#endif
199198

@@ -213,7 +212,6 @@ _Noreturn void __pthread_exit(void *result)
213212
// __syscall(SYS_exit) would unlock the thread, list
214213
// do it manually here
215214
__tl_unlock();
216-
// Can't use `exit()` here, because it is too high level
217215
for (;;) __wasi_thread_exit(0);
218216
#endif
219217
}
@@ -274,7 +272,7 @@ static int start_c11(void *p)
274272
}
275273
#else
276274
__attribute__((export_name("wasi_thread_start")))
277-
_Noreturn void wasi_thread_start(int tid, void *p)
275+
void wasi_thread_start(int tid, void *p)
278276
{
279277
struct start_args *args = p;
280278
__asm__(".globaltype __tls_base, i32\n"

libc-top-half/musl/src/thread/thrd_exit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44

55
_Noreturn void thrd_exit(int result)
66
{
7-
__pthread_exit((void*)(intptr_t)result);
7+
for (;;) __pthread_exit((void*)(intptr_t)result);
88
}

0 commit comments

Comments
 (0)