root.layoutInProgress = false;
    private void doRelayout(ReflowEvent evt) throws InterruptedException{        // if layout is already in progress        if (root.layoutInProgress) {            // Uu.p("layout already in progress. stopping  for" + evt);            if(root.layout_context != null) {                root.layout_context.stopRendering();            }            while (root.layoutInProgress) {                // NOTE: joshy: is this sleep necessary?                Uu.sleep(100);            }            // Uu.p("layout stopped now");        }            // spawn a new thread to start up the layout        new Thread(new Runnable() {            public void run() {                // Uu.p("starting up another thread for layout");                root.layoutInProgress = true;                root.doActualLayout(root.getGraphics());                root.layoutInProgress = false;                // Uu.p("layout thread finished");            }        }).start();        // NOTE: joshy: is this sleep necessary?        Uu.sleep(100);    }