Tmf.Ui: fix Multithreaded correctness - Call to static DateFormat
authorMatthew Khouzam <matthew.khouzam@ericsson.com>
Wed, 29 Apr 2015 15:13:35 +0000 (11:13 -0400)
committerMatthew Khouzam <matthew.khouzam@ericsson.com>
Tue, 12 May 2015 18:11:55 +0000 (14:11 -0400)
commit6dcc38b90a24e873a6623c9e7882e6335f79cade
tree9499d77745a5cb29ea3b29c6b7454df63ced2ec6
parent1157a34819d33138d4a4ba88c35ba31ab2bd9536
Tmf.Ui: fix Multithreaded correctness - Call to static DateFormat

The problem has been very well explained here:
http://fahdshariff.blogspot.ca/2010/08/dateformat-with-multiple-threads.html
As this code may be used in multi-threaded environments, not making it thread
safe will result in sporadically mangled dates. This patch fixes it by
synchronizing each access with the list of all items. More performance would
be had by using a threadlocal scheme where setting the timezone resets the
structure, but the legibility of the class would greatly suffer.

Change-Id: If8e9b118b3db15a2a0c088d4ebb2fa7c20839885
Signed-off-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/46792
Reviewed-by: Hudson CI
org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/widgets/timegraph/widgets/TimeGraphScale.java
This page took 0.027289 seconds and 5 git commands to generate.