Changeset 233


Ignore:
Timestamp:
11/11/02 18:18:51 (21 years ago)
Author:
piso
Message:

addEntriesToBuffer(): write locking.

File:
1 edited

Legend:

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

    r228 r233  
    33 *
    44 * Copyright (C) 2000-2002 Peter Graves
    5  * $Id: NewsGroupSummary.java,v 1.3 2002-11-11 14:15:20 piso Exp $
     5 * $Id: NewsGroupSummary.java,v 1.4 2002-11-11 18:18:51 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    157157            if (errorText != null)
    158158                MessageDialog.showMessageDialog(errorText, "Error");
    159             kill();
     159            if (Editor.getBufferList().contains(NewsGroupSummary.this))
     160                kill();
    160161        }
    161162    };
     
    181182    {
    182183        if (entries != null) {
    183             int limit = entries.size();
    184             for (int i = 0; i < limit; i++)
    185                 appendLine((NewsGroupSummaryEntry)entries.get(i));
    186             renumber();
     184            try {
     185                lockWrite();
     186            }
     187            catch (InterruptedException e) {
     188                Log.error(e);
     189                return;
     190            }
     191            try {
     192                int limit = entries.size();
     193                for (int i = 0; i < limit; i++)
     194                    appendLine((NewsGroupSummaryEntry)entries.get(i));
     195                renumber();
     196            }
     197            finally {
     198                unlockWrite();
     199            }
    187200        }
    188201    }
Note: See TracChangeset for help on using the changeset viewer.