This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: [RFA/JDWP] suspend counting for JDWP
- From: Tom Tromey <tromey at redhat dot com>
- To: Keith Seitz <keiths at redhat dot com>
- Cc: Java Patch List <java-patches at gcc dot gnu dot org>
- Date: 21 Sep 2006 18:12:22 -0600
- Subject: Re: [RFA/JDWP] suspend counting for JDWP
- References: <4512D737.9040309@redhat.com>
- Reply-to: tromey at redhat dot com
>>>>> "Keith" == Keith Seitz <keiths@redhat.com> writes:
Keith> Now that the last bits of missing JVMTI functionality are in, I can
Keith> submit this patch, which implements the JDWP methods
Keith> VMVirtualMachine.suspendThread, VMVirtualMachine.resumeThread and
Keith> VMVirtualMachine.getSuspendCount using JVMTI.
Keith> +// Thread suspension table. Maps Thread to suspend count
Keith> +static ::java::util::Hashtable *_jdwp_suspend_counts;
If possible stick this in a class somewhere. Over time I'd like to
see us get rid of globals which must be GC-scanned.
Keith> + _Jv_MonitorEnter (_jdwp_suspend_counts);
Use the JvSynchronize helper class instead of explicit enter/exit
pairs. It removes a whole class of potential errors. There's a few
places to do this...
Keith> + count = new Integer (1);
Integer.valueOf is slightly preferred nowadays -- it caches small
integers, which means less garbage. There's a few of these too.
Otherwise looks good, thanks.
Tom