[RFA/JDWP] suspend counting for JDWP
Keith Seitz
keiths@redhat.com
Fri Sep 22 01:58:00 GMT 2006
Tom Tromey wrote:
> 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.
Ah, yes, no problem. [In fact, I'm not sure why I did it this way to
begin with...]
> 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...
It also makes the code a little harder to read IMO. Fortunately, it's
only a teensy, weensy bit harder. :-)
> 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.
Done.
Updated patch attached.
Keith
ChangeLog
2006-09-21 Keith Seitz <keiths@redhat.com>
* gnu/classpath/jdwp/VMVirtualMachine.cc
(_jdwp_suspend_counts): New private variable.
* gnu/classpath/jdwp/natVMVirtualMachine.cc
(initialize): Initialize _jdwp_suspend_counts.
(suspendThread): Implement.
(resumeThread): Implement.
(getSuspendCount): Implement.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jdwp-suspendcounting-revised.patch
Type: text/x-patch
Size: 4677 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/java-patches/attachments/20060922/bab59172/attachment.bin>
More information about the Java-patches
mailing list