Created
July 16, 2018 12:31
-
-
Save olegchir/a4a8c39d410cb0dfeb86996647e9011d to your computer and use it in GitHub Desktop.
This file contains 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
object Config { | |
private val icon_ = AtomicReference<Image>() | |
val icon: Image | |
get() = icon_.get()!! | |
fun updateIcon(file: String) { | |
val imageData = Image(file) | |
icon_.compareAndSwap(icon_.get(), imageData.freeze()) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment