On Sat, 2006-07-01 at 14:57 +0200, Jeroen Frijters wrote: > Andrew John Hughes wrote: > > The attached patch fixes the initialization of the thread IDs > > in java.lang.Thread so that it starts at 1. 0 is not a valid > > thread ID, and was rightly being thrown out by the managment stuff. > > You just beat me to it! > > I hope you don't mind but I checked in my slightly more efficient fix. > This way Thread doesn't need to have a static initializer method. > > Regards, > Jeroen > > 2006-07-01 Jeroen Frijters <[EMAIL PROTECTED]> > > * java/lang/Thread.java: > Make thread IDs start from 1 in a more efficient way.
No problem; the new name makes things a bit clearer too. Really, though, according to the specification, the ids should be reused after the thread terminates (which both Tom's original solution and this patch don't handle). I don't know how necessary this is though, given that you'd have to have 2^63 - 1 threads to outrun available ids. Cheers, -- Andrew :-) Escape the Java Trap with GNU Classpath! http://www.gnu.org/philosophy/java-trap.html public class gcj extends Freedom implements Java { ... }
signature.asc
Description: This is a digitally signed message part
