Changeset 121


Ignore:
Timestamp:
10/13/02 16:55:03 (21 years ago)
Author:
piso
Message:

autosave(): always use a new thread.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/src/org/armedbear/j/Buffer.java

    r104 r121  
    33 *
    44 * Copyright (C) 1998-2002 Peter Graves
    5  * $Id: Buffer.java,v 1.9 2002-10-11 16:09:57 piso Exp $
     5 * $Id: Buffer.java,v 1.10 2002-10-13 16:55:03 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    17471747    }
    17481748
    1749     public synchronized boolean needsAutosave()
    1750     {
    1751         if (!Autosave.isAutosaveEnabled() || !autosaveEnabled)
    1752             return false;
    1753         return modCount != autosaveModCount;
    1754     }
    1755 
    1756     public void autosave(boolean wait)
    1757     {
    1758         if (!needsAutosave())
    1759             return;
    1760         Debug.assertTrue(getFile() != null);
    1761         if (wait)
    1762             autosaveInternal();
    1763         else
    1764             new Thread(autosaveRunnable).start();
    1765     }
    1766 
    1767     private Runnable autosaveRunnable = new Runnable() {
     1749    public synchronized void autosave()
     1750    {
     1751        if (autosaveEnabled && Autosave.isAutosaveEnabled())
     1752            if (modCount != autosaveModCount)
     1753                new Thread(autosaveRunnable, "autosave").start();
     1754    }
     1755
     1756    private final Runnable autosaveRunnable = new Runnable() {
    17681757        public void run()
    17691758        {
Note: See TracChangeset for help on using the changeset viewer.