Bug 166600 [DataBinding] Refactor tests to be in the correct packages
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/observable/ThreadRealm.java
*/
    public void asyncExec(Runnable runnable) {
        synchronized (queue) {
            queue.add(runnable);
            queue.notifyAll();
        }
    }
    
    public boolean isBlocking() {
        return block;
    }
    /**
     * Blocks the current thread invoking runnables.
     */
    public void block() {
        if (block) {
            throw new IllegalStateException("Realm is already blocking.");
        }
        
        if (Thread.currentThread() != thread) {
            throw new IllegalStateException("The current thread is not the correct thread.");
        }
        
        try {
            block = true;
            while (block) {
                Runnable runnable = null;
                synchronized (queue) {
                    while (queue.isEmpty()) {
                        queue.wait();