Rationalize synchronized blocks (eliminate deadlocks)
Two very common scenarios that expose deadlocks:
- Run Swing demo, inside is a terminal, run Xterm demo, resize Swing screen --> deadlock.
- Run Swing demo, inside is a terminal, run Xterm demo in sixel mode, open image inside terminal, drag to bottom row --> deadlock or NPE.
What these both amount to is lots of data/events coming in from both SwingTerminal and ECMA48/TTerminalWidget, while ScreenHandler is very busy too. 4 threads at minimum fighting over a few queues and screen.
I'm hungry. I think I'll find four philosophers to share a bowl of spaghetti with.