From: Martin Baulig Date: Wed, 17 May 2006 18:59:53 +0000 (+0000) Subject: 2006-05-17 Martin Baulig X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=39ffea8417eca93864f82e52f5c963ac0f2e28e1;p=gc 2006-05-17 Martin Baulig * pthread-support.c, pthread-stop-world.c: Put the debugger stuff inside a `#if LIBGC_MONO_DEBUGGER_SUPPORTED' conditional. svn path=/trunk/mono/; revision=60799 --- diff --git a/ChangeLog b/ChangeLog index a4fefc55..fc5b46cd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-05-17 Martin Baulig + + * pthread-support.c, pthread-stop-world.c: Put the debugger stuff + inside a `#if LIBGC_MONO_DEBUGGER_SUPPORTED' conditional. + 2006-05-17 Martin Baulig Fix a weird race condition which prevented XSP from working inside diff --git a/include/libgc-mono-debugger.h b/include/libgc-mono-debugger.h index ffeefd7a..f577a504 100644 --- a/include/libgc-mono-debugger.h +++ b/include/libgc-mono-debugger.h @@ -1,6 +1,8 @@ #ifndef LIBGC_MONO_DEBUGGER_H #define LIBGC_MONO_DEBUGGER_H +#ifdef LIBGC_MONO_DEBUGGER_SUPPORTED + #if defined(_IN_LIBGC_GC_H) || defined(_IN_THE_MONO_DEBUGGER) typedef struct @@ -25,3 +27,5 @@ GC_mono_debugger_add_all_threads (void); #endif +#endif + diff --git a/pthread_stop_world.c b/pthread_stop_world.c index 6291d47f..6c0ca18e 100644 --- a/pthread_stop_world.c +++ b/pthread_stop_world.c @@ -412,9 +412,11 @@ void GC_stop_world() /* We should have previously waited for it to become zero. */ # endif /* PARALLEL_MARK */ ++GC_stop_count; +#ifdef LIBGC_MONO_DEBUGGER_SUPPORTED if (gc_thread_vtable && gc_thread_vtable->stop_world) gc_thread_vtable->stop_world (); else +#endif pthread_stop_world (); # ifdef PARALLEL_MARK GC_release_mark_lock(); @@ -481,9 +483,11 @@ static void pthread_start_world() void GC_start_world() { +#ifdef LIBGC_MONO_DEBUGGER_SUPPORTED if (gc_thread_vtable && gc_thread_vtable->start_world) gc_thread_vtable->start_world(); else +#endif pthread_start_world (); } @@ -533,12 +537,16 @@ static void pthread_stop_init() { /* We hold the allocation lock. */ void GC_stop_init() { +#ifdef LIBGC_MONO_DEBUGGER_SUPPORTED if (gc_thread_vtable && gc_thread_vtable->initialize) gc_thread_vtable->initialize (); else +#endif pthread_stop_init (); } +#ifdef LIBGC_MONO_DEBUGGER_SUPPORTED + GCThreadFunctions *gc_thread_vtable = NULL; void @@ -556,5 +564,6 @@ GC_mono_debugger_add_all_threads (void) } } +#endif #endif diff --git a/pthread_support.c b/pthread_support.c index d3e387c4..4bad60f7 100644 --- a/pthread_support.c +++ b/pthread_support.c @@ -650,8 +650,10 @@ void GC_delete_thread(pthread_t id) } else { prev -> next = p -> next; } +#ifdef LIBGC_MONO_DEBUGGER_SUPPORTED if (gc_thread_vtable && gc_thread_vtable->thread_exited) gc_thread_vtable->thread_exited (id, &p->stop_info.stack_ptr); +#endif free(p); } @@ -929,8 +931,10 @@ void GC_thr_init() t -> stop_info.stack_ptr = (ptr_t)(&dummy); # endif t -> flags = DETACHED | MAIN_THREAD; +#ifdef LIBGC_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(); @@ -1236,8 +1240,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 LIBGC_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;