Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 15f0553

Browse files
committedAug 1, 2022
Define a Wasm global to store pthread_self
1 parent 33d6bc7 commit 15f0553

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed
 

‎libc-top-half/musl/src/thread/pthread_self.c

+6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
#include "pthread_impl.h"
22
#include <threads.h>
33

4+
#if defined(_REENTRANT)
5+
// We need some place to store the thread ID. This WebAssembly global fits the
6+
// bill and is used by `__get_tp` elsewhere.
7+
__asm__(".globaltype __wasilibc_pthread_self, i32\n");
8+
#endif
9+
410
static pthread_t __pthread_self_internal()
511
{
612
return __pthread_self();

0 commit comments

Comments
 (0)
Please sign in to comment.