Java CyclicBarrier getNumberWaiting() methodThe getNumberWaiting() method of the Java CyclicBarrier class is used to get the number of parties currently waiting at the barrier. This method is primarily useful for debugging and assertions. SyntaxReturnThe number of parties currently blocked in the wait. Example 1Test it NowOutput: Number of parties required to trip the barrier = 3 Sum of product and sum = 0 Is the barrier broken? - false Number of parties waiting at the barrier at this point = 0 Sum of product and sum = 36 Barrier reset successful
Next Topicjava CyclicBarrier
|