equal
deleted
inserted
replaced
16 |
16 |
17 final class Counter private { |
17 final class Counter private { |
18 private var count: Counter.ID = 0 |
18 private var count: Counter.ID = 0 |
19 |
19 |
20 def apply(): Counter.ID = synchronized { |
20 def apply(): Counter.ID = synchronized { |
21 require(count > java.lang.Long.MIN_VALUE, "counter overflow") |
21 require(count > Long.MinValue, "counter overflow") |
22 count -= 1 |
22 count -= 1 |
23 count |
23 count |
24 } |
24 } |
25 |
25 |
26 override def toString: String = count.toString |
26 override def toString: String = count.toString |