16 package net.squiz.matrix.ui;
18 import javax.swing.SwingUtilities;
34 private Thread thread;
40 private static class ThreadVar {
41 private Thread thread;
42 ThreadVar(Thread t) { thread = t; }
43 synchronized Thread
get() {
return thread; }
44 synchronized void clear() { thread = null; }
47 private ThreadVar threadVar;
60 private synchronized void setValue(Object x) {
81 Thread t = threadVar.get();
97 Thread t = threadVar.get();
104 catch (InterruptedException e) {
105 Thread.currentThread().interrupt();
117 final Runnable doFinished =
new Runnable() {
121 Runnable doConstruct =
new Runnable() {
130 SwingUtilities.invokeLater(doFinished);
134 Thread t =
new Thread(doConstruct);
135 threadVar =
new ThreadVar(t);
142 Thread t = threadVar.get();