Pools.SimplePool
open class Pools.SimplePool<T : Any> : Pools.Pool
Pools.SynchronizedPool |
Synchronized pool of objects. |
Simple (non-synchronized) pool of objects.
| Parameters | |
|---|---|
<T : Any> |
The pooled type. |
Summary
Public constructors |
|---|
<T : Any> SimplePool(maxPoolSize: @IntRange(from = 1) Int) |
Public functions |
|
|---|---|
open T? |
acquire() |
open Boolean |
release(instance: T)Release an instance to the pool. |
Public constructors
Public functions
release
open fun release(instance: T): Boolean
Release an instance to the pool.
| Parameters | |
|---|---|
instance: T |
The instance to release. |
| Returns | |
|---|---|
Boolean |
Whether the instance was put in the pool. |
| Throws | |
|---|---|
kotlin.IllegalStateException |
If the instance is already in the pool. |