c4f36e5766583218
V2EX  ›  问与答

Java : CyclicBarrier, CountDownLatch, 复用?

  •  
  •   c4f36e5766583218 · Apr 24, 2019 · 2082 views
    This topic created in 2706 days ago, the information mentioned may be changed or developed.
    • CyclicBarrier 是可以复用的,CyclicBarrier#await 在执行完指定数量后会对内部变量重置
    • CountDownLatch 无法进行重复使用。

    想问下 CountDownLatch 为什么不能复用或者复用会产生什么影响?不可以也 await 后重置吗?

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   900 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 20:58 · PVG 04:58 · LAX 13:58 · JFK 16:58
    ♥ Do have faith in what you're doing.