This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/6399] gettid() should have a wrapper
- From: "bugdal at aerifal dot cx" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Sat, 09 Feb 2013 00:40:09 +0000
- Subject: [Bug libc/6399] gettid() should have a wrapper
- Auto-submitted: auto-generated
- References: <bug-6399-131@http.sourceware.org/bugzilla/>
http://sourceware.org/bugzilla/show_bug.cgi?id=6399
--- Comment #13 from Rich Felker <bugdal at aerifal dot cx> 2013-02-09 00:40:09 UTC ---
In that case, you can always do the caching yourself:
int my_caching_gettid()
{
_Thread_local int tid;
return tid ? tid : gettid();
}
This might be mildly slower than having glibc do it just because of which TLS
model gets used; whether that matters would require some measurement, I think.
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.