summaryrefslogtreecommitdiff
path: root/threadproc
diff options
context:
space:
mode:
authormturk <mturk@13f79535-47bb-0310-9956-ffa450edef68>2006-08-24 07:24:35 +0000
committermturk <mturk@13f79535-47bb-0310-9956-ffa450edef68>2006-08-24 07:24:35 +0000
commiteb7a7f2e3a2b9d5ba4cd3d5effaf9019d889afd5 (patch)
treeea28d33dd2f541e83cb07550447ccb53dc21c840 /threadproc
parente493b77a9c55d1c31d3b32285c9a064e25c48e57 (diff)
downloadlibapr-eb7a7f2e3a2b9d5ba4cd3d5effaf9019d889afd5.tar.gz
Implement apr_threadkey_private destructors on WIN32
instead silently ignoring them. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@434327 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'threadproc')
-rw-r--r--threadproc/win32/threadpriv.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/threadproc/win32/threadpriv.c b/threadproc/win32/threadpriv.c
index 0cbfe620e..b1001e107 100644
--- a/threadproc/win32/threadpriv.c
+++ b/threadproc/win32/threadpriv.c
@@ -16,11 +16,16 @@
#include "apr_arch_threadproc.h"
#include "apr_thread_proc.h"
+#include "apr_hash.h"
#include "apr_general.h"
#include "apr_lib.h"
#include "apr_errno.h"
#include "apr_portable.h"
+#if defined(APR_DECLARE_EXPORT)
+apr_hash_t *apr_tls_threadkeys = NULL;
+#endif
+
APR_DECLARE(apr_status_t) apr_threadkey_private_create(apr_threadkey_t **key,
void (*dest)(void *),
apr_pool_t *pool)
@@ -33,6 +38,10 @@ APR_DECLARE(apr_status_t) apr_threadkey_private_create(apr_threadkey_t **key,
(*key)->pool = pool;
if (((*key)->key = TlsAlloc()) != 0xFFFFFFFF) {
+#if defined(APR_DECLARE_EXPORT)
+ apr_hash_set(apr_tls_threadkeys, &((*key)->key),
+ sizeof(DWORD), dest);
+#endif
return APR_SUCCESS;
}
return apr_get_os_error();
@@ -59,7 +68,11 @@ APR_DECLARE(apr_status_t) apr_threadkey_private_set(void *priv,
APR_DECLARE(apr_status_t) apr_threadkey_private_delete(apr_threadkey_t *key)
{
if (TlsFree(key->key)) {
- return APR_SUCCESS;
+#if defined(APR_DECLARE_EXPORT)
+ apr_hash_set(apr_tls_threadkeys, &(key->key),
+ sizeof(DWORD), NULL);
+#endif
+ return APR_SUCCESS;
}
return apr_get_os_error();
}
@@ -97,5 +110,5 @@ APR_DECLARE(apr_status_t) apr_os_threadkey_put(apr_threadkey_t **key,
}
(*key)->key = *thekey;
return APR_SUCCESS;
-}
+}