Patch for Review: Thread.interrupt() for MinGW
Mohan Embar
gnustuff@thisiscool.com
Thu Sep 18 13:08:00 GMT 2003
Hi Bryce,
Thanks for looking at this.
>> This patch attempts to implement Thread.interrupt() on MinGW.
>
>Have you run this against the Thread tests in the libjava testsuite?
>How does it do on those? I think I've got a few other stress tests for
>Thread.Interrupt lying around somewhere, I'll see if I can dig them up
>tomorrow if you want to try them.
Gladly. I haven't had the courage to try to figure out how to get DejaGNU
to work with Win32. Anthony Green wrote me and talked about needing a Telnet and
FTP daemon on my Win32 box. It sounds so complicated. I really do need to
figure this out, though, though I'd probably always write my own tests on
top of these.
>Why lazy initialization - wouldn't it be cleaner to set this up during
>thread initialization? IIRC there is a hook in the threads interface
>for exactly that.
I use the hook to initialize the critical section, but not the event. I am
following Adam's example here, where he warned in the comments that initialization
of a Win32 event is "insanely expensive". I haven't verified this, but it
stands to reason that a thread might never sleep, wait, or get interrupted.
>This would be better called _Jv_Win32GetInterruptEvent or some such, to
>emphasize that its win32 specific and not part of the standard
>interface.
Sounds good. In my first networking patch, I put stuff like this in a jvwin32
namespace, but Tom didn't seem to care for that. I also had the same concerns
that you did.
-- Mohan
http://www.thisiscool.com/
http://www.animalsong.org/
More information about the Java-patches
mailing list