线程异步问题

问题

  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

原文地址:https://www.cnblogs.com/lpthread/p/3410101.html