synchronizedOnSelf
Runs action while holding the monitor/lock associated with this receiver object, returning its result. Shorthand for synchronizedOn(this, action), used e.g. by the internal LRUCache and SimpleLRUCache implementations of Cache to guard all their read/write operations:
override val size
get() = synchronizedOnSelf { cache.size }Content copied to clipboard