hasen
05/17/2017, 9:32 AMobject counter {
private var counter : Int = 0
fun increment() {
mutext.lock()
counter++
mutext.unlock()
}
fun decrement() {
mutext.lock()
counter--
mutext.unlock()
}
fun get() = counter
fun isZero() = counter == 0
}