From f1e4a4a403f740c153acfc0cd96ecc5aa542e341 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 20 Mar 2001 18:35:13 +0000 Subject: Update. * sunrpc/Makefile (routines): Add rpc_thread. (CPPFLAGS): Add -D_RPC_THREAD_SAFE. * sunrpc/rpc_thread.c: New file. * sunrpc/Versions [libc] (GLIBC_2.2.3): Export __rpc_thread_destroy. * sunrpc/auth_none.c: Don't use global variables. Access state in thread-local storage. * sunrpc/clnt_perr.c: Likewise. * sunrpc/clnt_raw.c: Likewise. * sunrpc/clnt_simp.c: Likewise. * sunrpc/key_call.c: Likewise. * sunrpc/rpc_common.c: Likewise. * sunrpc/svc.c: Likewise. * sunrpc/svc_raw.c: Likewise. * sunrpc/svc_simple.c: Likewise. * sunrpc/svcauth_des.c: Likewise. * hurd/hurd/threadvar.h (enum __hurd_threadvar_index): Add _HURD_THREADVAR_RPC_VARS. * sysdeps/generic/bits/libc-tsd.h: Mention _LIBC_TSD_KEY_RPC_VARS. * include/rpc/rpc.h: Define data structures for internal thread-local "global" variables. Based on patches by Eric Norum . --- sunrpc/svcauth_des.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'sunrpc/svcauth_des.c') diff --git a/sunrpc/svcauth_des.c b/sunrpc/svcauth_des.c index 56b683a3ab..4530066a45 100644 --- a/sunrpc/svcauth_des.c +++ b/sunrpc/svcauth_des.c @@ -46,7 +46,7 @@ #include #include #include -#include +#include #include #include #include @@ -71,8 +71,13 @@ struct cache_entry struct rpc_timeval laststamp; /* detect replays of creds */ char *localcred; /* generic local credential */ }; -static struct cache_entry *authdes_cache /* [AUTHDES_CACHESZ] */ ; -static int *authdes_lru /* [AUTHDES_CACHESZ] */ ; +#ifdef _RPC_THREAD_SAFE_ +#define authdes_cache ((struct cache_entry *)RPC_THREAD_VARIABLE(authdes_cache_s)) +#define authdes_lru ((int *)RPC_THREAD_VARIABLE(authdes_lru_s)) +#else +static struct cache_entry *authdes_cache; +static int *authdes_lru; +#endif static void cache_init (void) internal_function; /* initialize the cache */ static short cache_spot (des_block *, char *, struct rpc_timeval *) -- cgit v1.2.3