summaryrefslogtreecommitdiffstats
path: root/contrib/gcc/gthr-vxworks.h
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>1999-10-16 06:09:09 +0000
committerobrien <obrien@FreeBSD.org>1999-10-16 06:09:09 +0000
commitcae8fa8120c70195f34a2456f18c4c848a2d3e0c (patch)
treef7d3a3ab9c32694206552e767626366f016f2062 /contrib/gcc/gthr-vxworks.h
parent84656b55b6e25e30322dc903a05de53706361d3d (diff)
downloadFreeBSD-src-cae8fa8120c70195f34a2456f18c4c848a2d3e0c.zip
FreeBSD-src-cae8fa8120c70195f34a2456f18c4c848a2d3e0c.tar.gz
Virgin import of the GCC 2.95.1 compilers
Diffstat (limited to 'contrib/gcc/gthr-vxworks.h')
-rw-r--r--contrib/gcc/gthr-vxworks.h18
1 files changed, 14 insertions, 4 deletions
diff --git a/contrib/gcc/gthr-vxworks.h b/contrib/gcc/gthr-vxworks.h
index 9876646..6d51ded 100644
--- a/contrib/gcc/gthr-vxworks.h
+++ b/contrib/gcc/gthr-vxworks.h
@@ -60,11 +60,16 @@ extern __gthread_key_t eh_context_key;
don't map well enough onto VxWorks. */
static void
-__ehdtor ()
+__ehdtor (void *pTcb)
{
- if (eh_context_key)
- free ((void*)eh_context_key);
- eh_context_key = 0;
+ int tid = (int) pTcb;
+ void *p = (void*)taskVarGet(tid, &eh_context_key);
+ if (p != (void*)-1)
+ {
+ if (p)
+ free (p);
+ taskVarSet(tid, &eh_context_key, 0);
+ }
}
/* This only works for the code in libgcc2.c. */
@@ -74,6 +79,11 @@ __gthread_key_create (__gthread_key_t *key, void (*dtor) (void *))
{
*key = 0;
+ /* Do this first so that the task variables are visible during the
+ running of the delete hook. */
+
+ taskVarInit();
+
/* We don't have a way to track dtor here, so instead, we
register a generic routine that can cleanup any task. */
OpenPOWER on IntegriCloud