summaryrefslogtreecommitdiff
path: root/src/internal/pthread_impl.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/internal/pthread_impl.h')
-rw-r--r--src/internal/pthread_impl.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/internal/pthread_impl.h b/src/internal/pthread_impl.h
index 3c2bd767..58e06136 100644
--- a/src/internal/pthread_impl.h
+++ b/src/internal/pthread_impl.h
@@ -115,8 +115,10 @@ struct __timer {
#ifdef TLS_ABOVE_TP
#define TP_ADJ(p) ((char *)(p) + sizeof(struct pthread) + TP_OFFSET)
+#define __pthread_self() ((pthread_t)(__get_tp() - sizeof(struct __pthread) - TP_OFFSET))
#else
#define TP_ADJ(p) (p)
+#define __pthread_self() ((pthread_t)__get_tp())
#endif
#ifndef tls_mod_off_t