import java.util.*;
//被操作的数据对象,即要被保护的数据对象
class DataBuff {
private LinkedList buff;
public DataBuff() {
buff = new LinkedList();
}
//被同步,保证当某线程增加数据时,所有某它的线程不能对队列的修改
public synch
/**
@version 1.20 1999-04-26
@author Cay Horstmann
*/
/**
This program shows how to avoid data corruption
when multiple threads access a data structure
*/
public class SynchBan