c4f36e5766583218
V2EX  ›  问与答

Java : CyclicBarrier, CountDownLatch, 复用?

  •  
  •   c4f36e5766583218 · Apr 24, 2019 · 1889 views
    This topic created in 2575 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   ·   Solana   ·   5793 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 06:34 · PVG 14:34 · LAX 23:34 · JFK 02:34
    ♥ Do have faith in what you're doing.