+2006-05-17 Martin Baulig <martin@ximian.com>
+
+ * pthread-support.c, pthread-stop-world.c: Put the debugger stuff
+ inside a `#if LIBGC_MONO_DEBUGGER_SUPPORTED' conditional.
+
2006-05-17 Martin Baulig <martin@ximian.com>
Fix a weird race condition which prevented XSP from working inside
#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
#endif
+#endif
+
/* 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();
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 ();
}
/* 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
}
}
+#endif
#endif
} 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);
}
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();
/* 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;