ConcurrentCache

class ConcurrentCache<K : Any, V : Any>

A thread-safe map that associates each key with at most one value: concurrent getOrPut calls for the same key always return the same instance, making it safe to store mutable values.

On platforms without multithreading, a plain map is a valid implementation.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
fun getOrPut(key: K, compute: () -> V): V