Example usage for java.util Set notifyAll

List of usage examples for java.util Set notifyAll

Introduction

In this page you can find the example usage for java.util Set notifyAll.

Prototype

@HotSpotIntrinsicCandidate
public final native void notifyAll();

Source Link

Document

Wakes up all threads that are waiting on this object's monitor.

Usage

From source file:com.netflix.curator.framework.recipes.queue.TestDistributedQueue.java

private void addToTakenItems(TestQueueItem message, Set<TestQueueItem> takenItems, int itemQty) {
    synchronized (takenItems) {
        takenItems.add(message);/*  w  w  w .j ava  2 s.c o  m*/
        if (takenItems.size() > itemQty) {
            takenItems.notifyAll();
        }
    }
}