/**
* pTitle: 线程同步/p
* pDescription: 通过使用同步锁实现对共享数据的操作/p
* pCopyright: Copyright (c) 2003/p
* pFilename: SyThreadDemo.java/p
* @version 1.0
*/
/**
*br类说明:主程序
*br功能描述:构造两个线程,并启动它们
*/
public class SyThreadDemo
{
public static void main (String [] args)
{
trade ft = new trade ();
addThread tt1 = new addThread (ft, "add");
decThread tt2 = new decThread (ft, "dec");
tt1.start ();
tt2.start ();
}
}
/**
*br类说明:同步类
*br功能描述:保存共享数据,[ 查看全文 ]