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]

Re: [RFA/JDWP] suspend counting for JDWP


>>>>> "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


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