Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZoltan Varga <vargaz@gmail.com>2008-08-03 04:18:48 +0400
committerZoltan Varga <vargaz@gmail.com>2008-08-03 04:18:48 +0400
commitb0ef4ab2c4c78e3eef9d13cccdca16c5680cdfb3 (patch)
tree1aaa958ef81ca5b4b95bdd9afbd945ae808321a4 /libgc/pthread_support.c
parentcbe103cb5c67b5699c36ed48416b14c52069ecd0 (diff)
2008-08-03 Zoltan Varga <vargaz@gmail.com>
* pthread_support.c (GC_thread_exit_proc): Null out the tls key to prevent the dtor function from being callled, since that would read freed memory. svn path=/trunk/mono/; revision=109502
Diffstat (limited to 'libgc/pthread_support.c')
-rw-r--r--libgc/pthread_support.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libgc/pthread_support.c b/libgc/pthread_support.c
index 6306f2cd0ce..7b0c084e8bb 100644
--- a/libgc/pthread_support.c
+++ b/libgc/pthread_support.c
@@ -1192,6 +1192,11 @@ void GC_thread_exit_proc(void *arg)
me = GC_lookup_thread(pthread_self());
GC_destroy_thread_local(me);
if (me -> flags & DETACHED) {
+# ifdef THREAD_LOCAL_ALLOC
+ /* NULL out the tls key to prevent the dtor function from being called */
+ if (0 != GC_setspecific(GC_thread_key, NULL))
+ ABORT("Failed to set thread specific allocation pointers");
+#endif
GC_delete_thread(pthread_self());
} else {
me -> flags |= FINISHED;