Save the date! Android Dev Summit is coming to Sunnyvale, CA on Oct 23-24, 2019.

SynchronizedPool

class SynchronizedPool<T : Any!> : Pools.SimplePool<T>
kotlin.Any
   ↳ androidx.core.util.Pools.SimplePool<T>
   ↳ androidx.core.util.Pools.SynchronizedPool

Synchronized) pool of objects.

Summary

Public constructors
<init>(maxPoolSize: Int)

Creates a new instance.

Public methods
open T?

open Boolean
release(@NonNull element: T)

Public constructors

<init>

SynchronizedPool(maxPoolSize: Int)

Creates a new instance.

Parameters
maxPoolSize Int: The max pool size.
Exceptions
IllegalArgumentException If the max pool size is less than zero.

Public methods

acquire

open fun acquire(): T?

release

open fun release(@NonNull element: T): Boolean