> Documentation index: https://developer.android.com/reference/llms.txt

# Pools.Pool

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core.md.txt) [View Source](https://cs.android.com/search?q=file:androidx/core/util/Pools.kt+class:androidx.core.util.Pools.Pool) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core.md.txt#1.1.0)

*** ** * ** ***


```
interface Pools.Pool<T : Any>
```

<br />

Known direct subclasses [Pools.SimplePool](https://developer.android.com/reference/kotlin/androidx/core/util/Pools.SimplePool.md.txt)

|---|---|
| `Pools.SimplePool` | Simple (non-synchronized) pool of objects. |

Known indirect subclasses [Pools.SynchronizedPool](https://developer.android.com/reference/kotlin/androidx/core/util/Pools.SynchronizedPool.md.txt)

|---|---|
| `Pools.SynchronizedPool` | Synchronized pool of objects. |

*** ** * ** ***

Interface for managing a pool of objects.

| Parameters |
|---|---|
| `<T : Any>` | The pooled type. |

## Summary

| ### Public functions |
|---|---|
| `T?` | `acquire()` Returns an instance from the pool if such, null otherwise. |
| `Boolean` | `release(instance: T)` Release an instance to the pool. |

## Public functions

### acquire

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core.md.txt#1.1.0)

```
fun acquire(): T?
```

Returns an instance from the pool if such, null otherwise.

### release

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core.md.txt#1.1.0)

```
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 |
|---|---|
| `IllegalStateException` | If the instance is already in the pool. |