Skip to content

Instantly share code, notes, and snippets.

@olegchir
Created July 16, 2018 12:31
Show Gist options
  • Save olegchir/a4a8c39d410cb0dfeb86996647e9011d to your computer and use it in GitHub Desktop.
Save olegchir/a4a8c39d410cb0dfeb86996647e9011d to your computer and use it in GitHub Desktop.
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