Re: [tcljava-user] JACL eval cancellation
Brought to you by:
mdejong
|
From: Mo D. <mo...@mo...> - 2007-03-15 00:37:06
|
Wei Dai wrote:
>
> Hi Mo,
>
> Just got a chance to try it out, it seems that the cancellation only
> takes effect for a loop, so the following case did not work:
>
> 1. Cancellation of single command such as After 10000 did not work.
> 2. Cancellation of a proc: if the proc contains a loop ( I tried
> while loop ), it will break out of the while loop and return from the
> proc immediately, but if there is no while loop, it will continue
> executing all the remaining statement/command in the proc as if there
> is no cancellation.
>
This is not a bug, it is likely caused by a race condition. The cancel
check happens after an eval() operation is done. See
when checkInterrupted() in invoked in Interp.java. It sounds like this
exception check happens later than you expect
in the script. It has nothing to do with loop commands, it has to do
with when an eval() operation ends.
> 3. Why TclEvent.sync() API implementation eats
> InterruptedException :
>
> * while* (!isProcessed) {
>
> * try* {
>
> wait(0);
>
> }* catch* (InterruptedException e) {
>
> continue;
>
> }
>
> }
>
> Are those known issues/limitations or am I missing something here?
>
A Jacl interp uses TclInterruptedException, the InterruptedException
above is a Java primitive class that has nothing
to do with this Jacl feature.
cheers
Mo
|