aboutsummaryrefslogtreecommitdiff
path: root/v_windows/v/old/vlib/sync/threads
diff options
context:
space:
mode:
authorIndrajith K L2022-12-03 17:00:20 +0530
committerIndrajith K L2022-12-03 17:00:20 +0530
commitf5c4671bfbad96bf346bd7e9a21fc4317b4959df (patch)
tree2764fc62da58f2ba8da7ed341643fc359873142f /v_windows/v/old/vlib/sync/threads
downloadcli-tools-windows-master.tar.gz
cli-tools-windows-master.tar.bz2
cli-tools-windows-master.zip
Adds most of the toolsHEADmaster
Diffstat (limited to 'v_windows/v/old/vlib/sync/threads')
-rw-r--r--v_windows/v/old/vlib/sync/threads/threads.c.v13
-rw-r--r--v_windows/v/old/vlib/sync/threads/threads.v4
2 files changed, 17 insertions, 0 deletions
diff --git a/v_windows/v/old/vlib/sync/threads/threads.c.v b/v_windows/v/old/vlib/sync/threads/threads.c.v
new file mode 100644
index 0000000..02506c2
--- /dev/null
+++ b/v_windows/v/old/vlib/sync/threads/threads.c.v
@@ -0,0 +1,13 @@
+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.
+// NB: on some platforms like Android, linking -lpthread is not needed too.
+// See https://stackoverflow.com/a/31277163/1904615
+
+$if !windows && !android {
+ #flag -lpthread
+}
diff --git a/v_windows/v/old/vlib/sync/threads/threads.v b/v_windows/v/old/vlib/sync/threads/threads.v
new file mode 100644
index 0000000..f20fc0e
--- /dev/null
+++ b/v_windows/v/old/vlib/sync/threads/threads.v
@@ -0,0 +1,4 @@
+module threads
+
+// This file is just a placeholder.
+// The actual implementation is backend/platform specific, so see threads.c.v, threads.js.v etc.