X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=libgc%2Fpthread_support.c;h=e2fef71968d8ede640ccf7b900fb6dc7c5a63882;hb=363f5cef883c8fc1a0879d9a8d6b0298f4a7bdbc;hp=58a662e773be9cd2bc16c2075e925f3a9dc1f4fb;hpb=74cb09828e0fbc5f0223c0b42a6adc57bad33861;p=mono.git diff --git a/libgc/pthread_support.c b/libgc/pthread_support.c index 58a662e773b..e2fef71968d 100644 --- a/libgc/pthread_support.c +++ b/libgc/pthread_support.c @@ -191,6 +191,10 @@ static __thread MONO_TLS_FAST void* GC_thread_tls; static GC_bool keys_initialized; +#ifdef MONO_DEBUGGER_SUPPORTED +#include "include/libgc-mono-debugger.h" +#endif + /* Recover the contents of the freelist array fl into the global one gfl.*/ /* Note that the indexing scheme differs, in that gfl has finer size */ /* resolution, even if not all entries are used. */ @@ -692,6 +696,10 @@ void GC_delete_thread(pthread_t id) } else { prev -> next = p -> next; } +#ifdef MONO_DEBUGGER_SUPPORTED + if (gc_thread_vtable && gc_thread_vtable->thread_exited) + gc_thread_vtable->thread_exited (id, &p->stop_info.stack_ptr); +#endif GC_INTERNAL_FREE(p); } @@ -767,11 +775,12 @@ void GC_remove_all_threads_but_me(void) GC_destroy_thread_local(p); } # endif /* THREAD_LOCAL_ALLOC */ - if (p != &first_thread) GC_INTERNAL_FREE(p); + if (p != &first_thread) GC_INTERNAL_FREE(p); } } GC_threads[hv] = me; } + GC_INTERNAL_FREE(p); } #endif /* HANDLE_FORK */ @@ -969,6 +978,10 @@ void GC_thr_init() t -> stop_info.stack_ptr = (ptr_t)(&dummy); # endif t -> flags = DETACHED | MAIN_THREAD; +#ifdef MONO_DEBUGGER_SUPPORTED + if (gc_thread_vtable && gc_thread_vtable->thread_created) + gc_thread_vtable->thread_created (pthread_self (), &t->stop_info.stack_ptr); +#endif GC_stop_init(); @@ -1274,6 +1287,10 @@ void * GC_start_routine_head(void * arg, void *base_addr, /* This is also < 100% convincing. We should also read this */ /* from /proc, but the hook to do so isn't there yet. */ # endif /* IA64 */ +#ifdef MONO_DEBUGGER_SUPPORTED + if (gc_thread_vtable && gc_thread_vtable->thread_created) + gc_thread_vtable->thread_created (my_pthread, &me->stop_info.stack_ptr); +#endif UNLOCK(); if (start) *start = si -> start_routine;