线程异步问题

问题

  ThreadA invoke ThreadB, and then update DB

  ThreadB read DB, expect the update DB is finished by ThreadA

  But in some condition, Thread A update DB is slow, ThreadB have finished and update DB is not started.

解决

  Use ReentrantLock

 

posted on 2013-11-06 11:21  lpthread  阅读(171)  评论(0编辑  收藏  举报