From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21623 invoked by alias); 20 Jun 2006 19:51:24 -0000 Received: (qmail 21608 invoked by uid 22791); 20 Jun 2006 19:51:23 -0000 X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 20 Jun 2006 19:51:21 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id k5KJpKAh017364 for ; Tue, 20 Jun 2006 15:51:20 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id k5KJpERu001663; Tue, 20 Jun 2006 15:51:14 -0400 Received: from [127.0.0.1] (sebastian-int.corp.redhat.com [172.16.52.221]) by pobox.corp.redhat.com (8.12.8/8.12.8) with ESMTP id k5KJpDH9006351; Tue, 20 Jun 2006 15:51:13 -0400 Message-ID: <449851B0.5020105@redhat.com> Date: Tue, 20 Jun 2006 19:51:00 -0000 From: Keith Seitz User-Agent: Thunderbird 1.5.0.4 (X11/20060516) MIME-Version: 1.0 To: Bryce McKinlay CC: Java Patch List Subject: Re: [RFA] Boehm GC support addition for debugging References: <4496CF73.7000507@redhat.com> <449848BF.8070503@redhat.com> In-Reply-To: <449848BF.8070503@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact java-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-patches-owner@gcc.gnu.org X-SW-Source: 2006-q2/txt/msg00440.txt.bz2 Bryce McKinlay wrote: >> * include/boehm-gc.h (_Jv_SuspendThread): Declare. >> (_Jv_ResumeThread): Declare. >> * boehm-gc.cc (_Jv_SuspnedThread): New function. >> (_Jv_ResumeThread): New function. Grr. Now I have a problem with this: + void + _Jv_SuspendThread (pthread_t thread) + { + if (thread == pthread_self ()) + GC_suspend_self (); + else + GC_suspend_thread (thread); + } + + void + _Jv_ResumeThread (pthread_t thread) + { + GC_resume_thread (thread); + } This going to break non-pthreads builds. There doesn't appear to be any abstract platform-independent threading convention between the GC and gcj. The GC uses GC_thread (which is private to the GC), and gcj uses either java.lang.Thread or _Jv_Thread_t. Alas, it looks like we have a couple of options: 1) Place ifdefs around the code for all the various cases. I presume these are pthreads, win32, and ??? 2) Make GC_thread and GC_lookup_thread public in the GC 3) Abstract what the GC wants in posix-threads.cc (_Jv_Thread_t->data->thread) and win32-threads.cc (_Jv_Thread_t->data->thread_obj). Still have to do #1, though... 4) Something else I've missed Sorry about the can of worms. I should have sought a solution to this before posting my patch. I'll keep digging. Keith