> Hi,
>
[quoted text clipped - 4 lines]
> I was wondering if it is safe to write to a (private) field from the
> SwingWorker finished method, while the listeners read the private field.
IIRC, the finished() method executes in the AWT EDT, so it
is safe, because the listeners also run in the AWT EDT.
Otherwise, you would have to surround the accesses/modifies
with a synchronized{} block to force cache flushing to main
memory, or maybe use the volatile keyword.
> example:
>
[quoted text clipped - 51 lines]
> SwingWorker in combination with progress and interrupt.
> Thanks for any help!
Rob - 17 Feb 2005 08:35 GMT
>>Hi,
>>
[quoted text clipped - 7 lines]
> IIRC, the finished() method executes in the AWT EDT, so it
> is safe, because the listeners also run in the AWT EDT.
This is what I was thinking too.
Thanks. I hope you remember correctly :)