心如止水

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2012年4月24日

摘要: 1. The following sample uses threads and lock. As long as the lock statement is present, the statement block is a critical section and balance will never become a negative number. // using System.Threading; class Account { private Object thisLock = new Object(); int balance; ... 阅读全文
posted @ 2012-04-24 16:58 cutebear 阅读(621) 评论(0) 推荐(0) 编辑