summaryrefslogtreecommitdiffstats
path: root/libc
diff options
context:
space:
mode:
author"Steven J. Hill" <sjhill@realitydiluted.com>2006-02-05 05:51:20 +0000
committer"Steven J. Hill" <sjhill@realitydiluted.com>2006-02-05 05:51:20 +0000
commitde94610a30e6e4d6fc0999104e7b278b57819fec (patch)
tree73cf798745eb7f7387b2fa898ae022a67c40c46b /libc
parent306b3cfddaeafd14197c4e59ea42803f45f049be (diff)
downloaduClibc-alpine-de94610a30e6e4d6fc0999104e7b278b57819fec.tar.bz2
uClibc-alpine-de94610a30e6e4d6fc0999104e7b278b57819fec.tar.xz
Fix RPC thread key usage.
Diffstat (limited to 'libc')
-rw-r--r--libc/inet/rpc/rpc_thread.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/libc/inet/rpc/rpc_thread.c b/libc/inet/rpc/rpc_thread.c
index 12b7f2216..f716444a3 100644
--- a/libc/inet/rpc/rpc_thread.c
+++ b/libc/inet/rpc/rpc_thread.c
@@ -11,13 +11,7 @@
/* Variable used in non-threaded applications or for the first thread. */
static struct rpc_thread_variables __libc_tsd_RPC_VARS_mem;
-#ifdef __UCLIBC_HAS_THREADS_NATIVE__
-static struct rpc_thread_variables *__libc_tsd_RPC_VARS =
- &__libc_tsd_RPC_VARS_mem;
-#else
-static struct rpc_thread_variables *__libc_tsd_RPC_VARS_data =
- &__libc_tsd_RPC_VARS_mem;
-#endif
+__libc_tsd_define (, RPC_VARS)
/*
* Task-variable destructor
@@ -25,7 +19,7 @@ static struct rpc_thread_variables *__libc_tsd_RPC_VARS_data =
void
__rpc_thread_destroy (void)
{
- struct rpc_thread_variables *tvp = __rpc_thread_variables();
+ struct rpc_thread_variables *tvp = __libc_tsd_get (RPC_VARS);
if (tvp != NULL && tvp != &__libc_tsd_RPC_VARS_mem) {
__rpc_thread_svc_cleanup ();
@@ -38,6 +32,7 @@ __rpc_thread_destroy (void)
free (tvp->authdes_cache_s);
free (tvp->authdes_lru_s);
free (tvp);
+ __libc_tsd_set (RPC_VARS, NULL);
}
}
@@ -66,11 +61,7 @@ __rpc_thread_variables (void)
if (tvp != NULL)
__libc_tsd_set (RPC_VARS, tvp);
else
-#ifdef __UCLIBC_HAS_THREADS_NATIVE__
tvp = __libc_tsd_RPC_VARS;
-#else
- tvp = __libc_tsd_RPC_VARS_data;
-#endif
}
}
return tvp;