internal class A { private val isOpen = true // ideally should be atomic boolean }