1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

cgen: support [spawn_stack: 131072] fn attribute, for controlling the max size of the stack, of the spawned threads (#17222)

This commit is contained in:
MatejMagat305
2023-02-09 14:57:53 +01:00
committed by GitHub
parent 19ba7c5ceb
commit dcb9c3beb3
9 changed files with 126 additions and 2 deletions

View File

@@ -0,0 +1,19 @@
module main
fn main() {
th := spawn my_print1()
th.wait()
th2 := spawn my_print2()
th2.wait()
}
// default stack size
fn my_print1() {
println('hello word')
}
// 2MB stack size
[spawn_stack: 2097152]
fn my_print2() {
println('ahoj svet')
}