SynchronizedPool

expect class SynchronizedPool<T> : Pool<T>
actual class SynchronizedPool<T> : Pool<T>

Kotlin/Native threads are real - decode workers and the render thread share these pools, so acquire/release must lock or two consumers can be handed the same pooled instance.

actual open class SynchronizedPool<T> : Pool<T>
actual class SynchronizedPool<T> : BasicPool<T> , Pool<T>

JS use BasicPool instead of SynchronizedPool

Constructors

Link copied to clipboard
expect constructor()
constructor()
constructor()
constructor()

Functions

acquire
Link copied to clipboard
expect open override fun acquire(): T?

Acquires an instance from the pool. This returns null if the pool is empty.

actual open override fun acquire(): T?

Acquires an instance from the pool. This returns null if the pool is empty.

actual open override fun acquire(): T?

Acquires an instance from the pool. This returns null if the pool is empty.

open override fun acquire(): T?

Acquires an instance from the pool. This returns null if the pool is empty.

release
Link copied to clipboard
expect open override fun release(instance: T?)

Releases an instance to the pool. This has no effect if the instance is null.

actual open override fun release(instance: T?)

Releases an instance to the pool. This has no effect if the instance is null.

actual open override fun release(instance: T?)

Releases an instance to the pool. This has no effect if the instance is null.

open override fun release(instance: T?)

Releases an instance to the pool. This has no effect if the instance is null.