summaryrefslogtreecommitdiffstats
path: root/vespajlib/src/main/java/com/yahoo/collections/ConcurrentResourcePool.java
diff options
context:
space:
mode:
Diffstat (limited to 'vespajlib/src/main/java/com/yahoo/collections/ConcurrentResourcePool.java')
-rw-r--r--vespajlib/src/main/java/com/yahoo/collections/ConcurrentResourcePool.java36
1 files changed, 0 insertions, 36 deletions
diff --git a/vespajlib/src/main/java/com/yahoo/collections/ConcurrentResourcePool.java b/vespajlib/src/main/java/com/yahoo/collections/ConcurrentResourcePool.java
deleted file mode 100644
index b49e0c8bbbc..00000000000
--- a/vespajlib/src/main/java/com/yahoo/collections/ConcurrentResourcePool.java
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-package com.yahoo.collections;
-
-import java.util.Iterator;
-import java.util.Queue;
-import java.util.concurrent.ConcurrentLinkedQueue;
-
-/**
- * @author baldersheim
- * TODO: remove on vespa 7 or before
- * Use com.yahoo.yolean.concurrent.ConcurrentResourcePool instead.
- */
-@Deprecated
-public class ConcurrentResourcePool<T> implements Iterable<T> {
-
- private final Queue<T> pool = new ConcurrentLinkedQueue<>();
- private final ResourceFactory<T> factory;
-
- public ConcurrentResourcePool(ResourceFactory<T> factory) {
- this.factory = factory;
- }
-
- public final T alloc() {
- final T e = pool.poll();
- return e != null ? e : factory.create();
- }
-
- public final void free(T e) {
- pool.offer(e);
- }
-
- @Override
- public Iterator<T> iterator() {
- return pool.iterator();
- }
-}