summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorKumar Aditya <kumaraditya@python.org>2024-10-13 15:29:41 (GMT)
committerGitHub <noreply@github.com>2024-10-13 15:29:41 (GMT)
commit08489325d1cd94eba97c5f5f8cac49521fd0b0d7 (patch)
tree7abda3e3208cfef789698ee2d51f4d6b4f71851d /Python
parent022c50d190e14affb952a244c4eb6e4a644ad0c9 (diff)
downloadcpython-08489325d1cd94eba97c5f5f8cac49521fd0b0d7.zip
cpython-08489325d1cd94eba97c5f5f8cac49521fd0b0d7.tar.gz
cpython-08489325d1cd94eba97c5f5f8cac49521fd0b0d7.tar.bz2
gh-125161: return non zero value in pthread_self on wasi (#125303)
Diffstat (limited to 'Python')
-rw-r--r--Python/thread_pthread_stubs.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/Python/thread_pthread_stubs.h b/Python/thread_pthread_stubs.h
index 4741e59..458f8fc 100644
--- a/Python/thread_pthread_stubs.h
+++ b/Python/thread_pthread_stubs.h
@@ -1,5 +1,9 @@
#include "cpython/pthread_stubs.h"
+typedef struct py_stub_tls_entry py_tls_entry;
+
+#define py_tls_entries (_PyRuntime.threads.stubs.tls_entries)
+
// mutex
int
pthread_mutex_init(pthread_mutex_t *restrict mutex,
@@ -105,7 +109,7 @@ pthread_join(pthread_t thread, void** value_ptr)
PyAPI_FUNC(pthread_t) pthread_self(void)
{
- return 0;
+ return (pthread_t)(uintptr_t)&py_tls_entries;
}
int
@@ -134,10 +138,6 @@ pthread_attr_destroy(pthread_attr_t *attr)
}
-typedef struct py_stub_tls_entry py_tls_entry;
-
-#define py_tls_entries (_PyRuntime.threads.stubs.tls_entries)
-
int
pthread_key_create(pthread_key_t *key, void (*destr_function)(void *))
{