Can deadlock happen for an arbitrary synchronised method which updates some Swing components if the threads which call to this method all use Swing Timer or SwingUtilities.invokeLater()
. I think that it will not be necessary to call invokeLater() inside Swing Timer tasks.
So I will have Some Swing timers and some observers that update my components. Observers all call invokeLater()
and Swing Timers call my arbitrary method updateComponents()
directly.
If it can still cause Deadlock, will invokeLater()
make me sure that no deadlock will happen?