v / examples / control_thread_stack_size.v
19 lines · 16 sloc · 251 bytes · 757929392e0e7a75fc1272116460981e589737d5
Raw
1module main
2
3fn main() {
4 th := spawn my_print1()
5 th.wait()
6 th2 := spawn my_print2()
7 th2.wait()
8}
9
10// default stack size
11fn my_print1() {
12 println('hello word')
13}
14
15// 2MB stack size
16@[spawn_stack: 2097152]
17fn my_print2() {
18 println('ahoj svet')
19}
20