Christian Vest Hansen wrote: > On 4/10/08, Colin Walters <[EMAIL PROTECTED]> wrote: >> Can't you just Thread.interrupt()? > > Interrupting a thread does not, to the best of my knowledge, guarentee > that an arbitrary body of code will actually stop running. If the code > does not invoke any method that might throw some InterruptedException, > then the onus is on the programmer (of said body of code) to check > what Thread.interrupted() says at regular intervals.
It does not interrupt arbitrary code in any way. That would not be safe, since locks could be held, resources could be left unresolved, and so on. Long story short, checkpointing is the only way, since the target thread must willingly "give up" in order for you to terminate its execution. - Charlie --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "JVM Languages" group. To post to this group, send email to jvm-languages@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/jvm-languages?hl=en -~----------~----~----~----~------~----~------~--~---