#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,
PyAPI_FUNC(pthread_t) pthread_self(void)
{
- return 0;
+ return (pthread_t)(uintptr_t)&py_tls_entries;
}
int
}
-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 *))
{