线程异步问题

it2022-05-08  6

问题

  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


最新回复(0)