From 2f5cd56506077356f2a76ef062fa0879f46e6ea4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciro=20Santilli=20=E5=85=AD=E5=9B=9B=E4=BA=8B=E4=BB=B6=20?= =?UTF-8?q?=E6=B3=95=E8=BD=AE=E5=8A=9F?= Date: Tue, 3 Dec 2019 00:00:00 +0000 Subject: [PATCH] pthread_self.c: mention gettid --- userland/posix/pthread_self.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/userland/posix/pthread_self.c b/userland/posix/pthread_self.c index 0c1d5ee..8ec8394 100644 --- a/userland/posix/pthread_self.c +++ b/userland/posix/pthread_self.c @@ -29,6 +29,10 @@ * .... * * Note how the PID is the same for all threads. + * + * There is then a Linux specific gettid which returns a really unique thread ID: + * https://stackoverflow.com/questions/9305992/if-threads-share-the-same-pid-how-can-they-be-identified#comment42637433_9306150 + * man gettid says that this value is different than pthread_self. */ #define _XOPEN_SOURCE 700