diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-03-28 09:26:28 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-03-28 09:26:28 +0000 |
commit | 9fd68c082693e2db323eee226f8f041a1a596cc9 (patch) | |
tree | 60bd2c4c9dd96be75e26bf7a55c401eb632b6850 /gcc/gthr-vxworks.h | |
parent | 9f9d16c921fcede880ddba43b970b29f0f888d8f (diff) |
Merge from mainlinebefore_gc_merge_990902egcs_gc_branch
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/egcs_gc_branch@26036 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gthr-vxworks.h')
-rw-r--r-- | gcc/gthr-vxworks.h | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/gcc/gthr-vxworks.h b/gcc/gthr-vxworks.h index 98766467818..6d51ded2cda 100644 --- a/gcc/gthr-vxworks.h +++ b/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. */ |