v / vlib / sync / threads / threads.c.v
13 lines · 11 sloc · 483 bytes · 36ec47cd203a1f119da74b868ceb92f6da7ea930
Raw
1module threads
2
3// This module adds the necessary compiler flags for using threads.
4// It is automatically imported by code that does `go func()` .
5// See vlib/v/parser/pratt.v, search for ast.GoExpr .
6// The goal is that programs, that do not use threads at all will not need
7// to link to -lpthread etc.
8// Note: on some platforms like Android, linking -lpthread is not needed too.
9// See https://stackoverflow.com/a/31277163/1904615
10
11$if !windows && !android {
12 #flag -lpthread
13}
14