01:41 pm - sparkymark - SwingWorker and race conditions If pressing a JButton caused the text on the button to become the output of some lengthy calculation, then I could use the Java 6 JRE (flavour of the) SwingWorker class to launch a separate thread to do that calculation (based on the current state of the system) and update the button text when it was "done".http://en.wikipedia.org/wiki/SwingWorker#Complete_Worker_exampleSuppose someone clicks the button again before the SwingWorker thread completes, the second SwingWorker might complete before the first and the text displayed on the button, when all worker threads have completed, would correspond to the state of the system when the button was *first* pushed. Since there is no way to reuse a worker thread, is SwingWorker appropriate for this scenario? Should the doInBackground method's of my SwingWorker share a Sempahore, acquired in doInBackground() and released in done()? Edit ...using java.util.concurrent.Semaphore(1,true) i.e. the fairness flag set, so that this solution would scale to three or more quick clicks...