问题

  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

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-03-06
  • 2022-12-23
  • 2021-11-18
  • 2021-08-23
  • 2021-09-20
  • 2021-04-19
猜你喜欢
  • 2021-04-22
  • 2021-09-11
  • 2022-12-23
  • 2018-11-21
  • 2021-12-18
相关资源
相似解决方案