Gitly
English
Русский
Español
日本語
中文
Português
Pricing
Log in
Register
vxx2
/
vlib
/
v
/
checker
/
tests
/
shared_lock.vv
24
lines
·
20
sloc
·
196 bytes
·
0c8ce3bcb9fd4a2e5bd5f991a5a07da976d780d7
Raw
1
struct St {
2
mut:
3
a int
4
}
5
6
fn (shared s St) r(x St) {
7
}
8
9
fn (s St) m(shared x St) {
10
}
11
12
fn f(w int, shared x St) {
13
}
14
15
fn g() {
16
shared x := St{
17
a: 5
18
}
19
lock x {
20
x.r(x)
21
x.m(x)
22
f(0, x)
23
}
24
}
25