1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
struct St { mut: x int } fn main() { shared a := &St{ x: 5 } lock a { rlock a { a.x++ } } println(a.x) }