mirror of
https://sourceware.org/git/glibc.git
synced 2025-01-08 18:30:18 +00:00
(test_loaded): Don't overwrite a value another thread might have found.
This commit is contained in:
parent
b7bdd9c4c9
commit
3b7c07d8f2
@ -22,6 +22,7 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <shlib-compat.h>
|
||||
#include <atomic.h>
|
||||
|
||||
|
||||
#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_3_2)
|
||||
@ -33,7 +34,7 @@ test_loaded (void)
|
||||
{
|
||||
/* While we are getting the result set the handle to (void *) -1 to
|
||||
avoid recursive calls. */
|
||||
libpthread_handle = (void *) -1l;
|
||||
atomic_compare_and_exchange_acq (&libpthread_handle, (void *) -1l, NULL);
|
||||
|
||||
void *h = __libc_dlopen_mode ("libpthread.so.0", RTLD_LAZY | RTLD_NOLOAD);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user