2021-05-14 13:28:53 +02:00
|
|
|
module threads
|
|
|
|
|
|
|
|
// This module adds the necessary compiler flags for using threads.
|
|
|
|
// It is automatically imported by code that does `go func()` .
|
|
|
|
// See vlib/v/parser/pratt.v, search for ast.GoExpr .
|
|
|
|
// The goal is that programs, that do not use threads at all will not need
|
|
|
|
// to link to -lpthread etc.
|
2022-03-06 18:01:22 +01:00
|
|
|
// Note: on some platforms like Android, linking -lpthread is not needed too.
|
2021-05-14 13:28:53 +02:00
|
|
|
// See https://stackoverflow.com/a/31277163/1904615
|
|
|
|
|
|
|
|
$if !windows && !android {
|
|
|
|
#flag -lpthread
|
|
|
|
}
|