< prev index next >

src/java.desktop/share/classes/javax/swing/text/LayoutQueue.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 48,57 **** --- 48,58 ---- tasks = new Vector<Runnable>(); } /** * Fetch the default layout queue. + * @return the default layout queue */ public static LayoutQueue getDefaultQueue() { AppContext ac = AppContext.getAppContext(); synchronized (DEFAULT_QUEUE) { LayoutQueue defaultQueue = (LayoutQueue) ac.get(DEFAULT_QUEUE);
*** 75,84 **** --- 76,86 ---- } /** * Add a task that is not needed immediately because * the results are not believed to be visible. + * @param task the task to add to the queue */ public synchronized void addTask(Runnable task) { if (worker == null) { worker = new LayoutThread(); worker.start();
*** 86,96 **** tasks.addElement(task); notifyAll(); } /** ! * Used by the worker thread to get a new task to execute */ protected synchronized Runnable waitForWork() { while (tasks.size() == 0) { try { wait(); --- 88,99 ---- tasks.addElement(task); notifyAll(); } /** ! * Used by the worker thread to get a new task to execute. ! * @return a task from the queue */ protected synchronized Runnable waitForWork() { while (tasks.size() == 0) { try { wait();
< prev index next >