This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFA] Boehm GC support addition for debugging


Hi,

It turns out I lied when I said I was only going to stub the _Jv_ThreadDebug* methods. I think I will submit them for approval, but first I need to add two new functions the GC interface: one to suspend threads and one to resume them. Is there a related doc patch that is required for GC interface expansions? I don't see anything. Is there another GC implementation in which I need to stub these methods?

I've ifdef'd out the code for this because I'm still awaiting word on the latest revision of my Boehm GC external thread suspension patch.

Keith

ChangeLog
2006-06-19  Keith Seitz  <keiths@redhat.com>

        * include/boehm-gc.h (_Jv_SuspendThread): Declare.
        (_Jv_ResumeThread): Declare.
        * boehm-gc.cc (_Jv_SuspnedThread): New function.
        (_Jv_ResumeThread): New function.
Index: include/boehm-gc.h
===================================================================
--- include/boehm-gc.h	(revision 114727)
+++ include/boehm-gc.h	(working copy)
@@ -1,7 +1,7 @@
 // -*- c++ -*-
 // boehm-gc.h - Defines for Boehm collector.
 
-/* Copyright (C) 1998, 1999, 2002, 2004  Free Software Foundation
+/* Copyright (C) 1998, 1999, 2002, 2004, 2006  Free Software Foundation
 
    This file is part of libgcj.
 
@@ -83,4 +83,10 @@
 // _Jv_AllocBytes (jsize size) should go here, too.  But clients don't
 // usually include this header.
 
+// Suspend the given thread. This includes suspending the calling thread.
+extern "C" void _Jv_SuspendThread (pthread_t);
+
+// Resume a suspended thread.
+extern "C" void _Jv_ResumeThread (pthread_t);
+
 #endif /* __JV_BOEHM_GC__ */
Index: boehm.cc
===================================================================
--- boehm.cc	(revision 114727)
+++ boehm.cc	(working copy)
@@ -673,3 +673,21 @@
 #endif
 }
 
+void
+_Jv_SuspendThread (pthread_t thread)
+{
+#ifdef WAITING_FOR_GC_PATCH_APPROVAL
+  if (thread == pthread_self ())
+    GC_suspend_self ();
+  else
+    GC_suspend_thread (thread);
+#endif
+}
+
+void
+_Jv_ResumeThread (pthread_t thread)
+{
+#ifdef WAITING_FOR_GC_PATCH_APPROVAL
+  GC_resume_thread (thread);
+#endif
+}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]