On 4/10/08, Colin Walters <[EMAIL PROTECTED]> wrote: > > On Apr 9, 7:49 am, easieste <[EMAIL PROTECTED]> wrote: > > Working in Common Lisp on the JVM, I wish to emulate the semantics of > > a typical thread library (there is nothing in ANSI about such > > interfaces, they vary widely) > > > > (WITH-TIMEOUT timeout &REST body) > > > > which runs an arbitrary BODY of code on a new thread until TIMEOUT > > seconds have elapsed, upon which the thread is terminated > > unceremoniously. > > > 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. > > > > -- Venlig hilsen / Kind regards, Christian Vest Hansen. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "JVM Languages" group. To post to this group, send email to [email protected] 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 -~----------~----~----~----~------~----~------~--~---
