Created
June 9, 2020 16:25
-
-
Save jonnyzzz/5f8eb0df795e28f179e890c8308fbcad to your computer and use it in GitHub Desktop.
Delegated Properties with Atomic References in Kotlin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class X | |
| operator fun <Y> AtomicReference<Y>.getValue(x: Any?, p: KProperty<*>) : Y = this.get() | |
| operator fun <Y> AtomicReference<Y>.setValue(x: Any?, p: KProperty<*>, value: Y) { this.set(value) } | |
| val myStats by AtomicReference<X>(null) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment