New issue 28 by guy...@gmail.com: JFreeChart not thread safe
http://code.google.com/p/opentestbed/issues/detail?id=28
I believe the creation of the JFreeChart GUI and all modifications to it
should go through
SwingUtilities.invokeLater(...)
to make it threadsafe.
Right now the main thread makes these updates.
All updates should be done in the SwingThread already as a
javax.swing.Timer is used for the updates.
One could discuss whether building the initial frame should be done on the
UIThread as well, but as far as I know it is allowed to create a GUI on a
foreign thread as long as its not made visible.
One could also discuss the upateBankroll method, as read-access on
currentGamesPlayed + currentSeatPermutation is not synchronized (but they
are volatile), but I thought noone would care if on the GUI both values are
one off compared to the graph.
Changes/Read-Access to the 'stats' variable is synchronized though.
So from my point of view we have no threading problems.