struct St { mut: x int // data to be shared } fn (shared b St) g(shared c St) { lock b { b.x = 100 } } fn foo(shared b St) { lock b { b.x = 101 } } fn main() { shared a := St{ x: 10 } spawn a.g(a) spawn foo(a) rlock a { println(a.x) } }