Thanks Carsten!

I removed that interrupt() call on trunk.

On why it got interrupted? I'm not sure. I guess anyone could call
Thread.interrupt()...

Cheers,

David

On 21 March 2015 at 09:52, Carsten Ziegeler <cziege...@apache.org> wrote:
> Good question - The call to interrupt() is wrong. If the thread gets
> interrupted while in wait(), the catch block resets the interrupt flag
> and the current thread stays in the for loop. Then it hits wait and as
> the interrupted flag is set, it throws an interrupted exception, and the
> game starts again. So this will basically create a busy loop once this
> thread gets interrupted.
>
> I assume, as the thread is holding the lock on this and it's a busy
> loop, the other thread who wants to get the lock on this has no chance
> as once this thread is interrupted, it never waits. This would explain
> why it never leaves the loop.
>
> Question remains, why the thread got interrupted in the first place.
>
> Carsten
> --
> Carsten Ziegeler
> Adobe Research Switzerland
> cziege...@apache.org

Reply via email to