[Bug dynamic-link/21777] use of pthread_getspecific, pthread_setspecific in a statically linked program leads to a crash before main

bruno at clisp dot org sourceware-bugzilla@sourceware.org
Sun Sep 2 09:01:00 GMT 2018


https://sourceware.org/bugzilla/show_bug.cgi?id=21777

--- Comment #4 from Bruno Haible <bruno at clisp dot org> ---
(In reply to Paul Pluzhnikov from comment #3)
> - calls pthread_setspecific() and
> - doesn't call pthread_mutex*
> 
> seems like an exceedingly contrived example.

Not at all. The comment in the test program explains it:
"To make it multithread-safe, without need for a lock that protects the
 already allocated memory, store the allocated memory per thread."
So, pthread_setspecific and pthread_mutex* are different techniques for making
a program multithread-safe. I should be able to pick one without the other.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Glibc-bugs mailing list