From 3b391db91f70b2166951413ee1eccc78cd398a44 Mon Sep 17 00:00:00 2001 From: Richard Braun Date: Wed, 19 Feb 2014 21:30:22 +0100 Subject: Make name resolution thread-safe * pthread/pt-alloc.c (initialize_pthread): Reset resolver state. * pthread/pt-create.c: Include . (entry_point): Update the __resp TLS variable to point to the resolver state of the current thread. * pthread/pt-internal.h: Define __need_res_state and include . (struct __pthread): New `res_state' member. --- pthread/pt-internal.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'pthread/pt-internal.h') diff --git a/pthread/pt-internal.h b/pthread/pt-internal.h index 7465761..eca63a1 100644 --- a/pthread/pt-internal.h +++ b/pthread/pt-internal.h @@ -25,6 +25,8 @@ #include #include #include +#define __need_res_state +#include #include @@ -107,6 +109,9 @@ struct __pthread pthread_mutex_t state_lock; /* Locks the state. */ pthread_cond_t state_cond; /* Signalled when the state changes. */ + /* Resolver state. */ + struct __res_state res_state; + /* Thread context. */ struct pthread_mcontext mcontext; -- cgit v1.2.3