线程安全 二
摘要:
usingSystem;usingSystem.Threading;abstractclassCounter{protectedintcount=0;publicabstractintRead(intthreadNum);publicabstractvoidIncrement(intthreadNum);}//NotethattheinstancevariablecountissharedbetweenthetwomethodsRead//andIncrement.Threadsconcurrentlyexecutingoneorbothofthesemethodscan//interfere 阅读全文
posted @ 2011-11-15 11:41 言午 阅读(190) 评论(0) 推荐(0) 编辑