import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
+import java.util.concurrent.CountDownLatch;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
private final TransientState transState;
private final IStateHistoryBackend backend;
+ /* Latch tracking if the state history is done building or not */
+ private final CountDownLatch finishedLatch = new CountDownLatch(1);
+
/**
* General constructor
*
/* We're opening an existing file */
this.attributeTree = new AttributeTree(this, backend.supplyAttributeTreeReader());
transState.setInactive();
+ finishedLatch.countDown(); /* The history is already built */
+ }
+ }
+
+ @Override
+ public void waitUntilBuilt() {
+ try {
+ finishedLatch.await();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
}
}
*/
attributeTree.writeSelf(attributeTreeFile, attributeTreeFilePos);
}
+ finishedLatch.countDown(); /* Mark the history as finished building */
}
//--------------------------------------------------------------------------