Skip to content

Commit 276c250

Browse files
ringaboutkonsumlamm
authored andcommitted
default threads on (nim-lang#19368)
* default threads on * make rst gcsafe * ignore threads option for nimscript * threads off * use createShared for threads * test without threads * avr threds off * avr threads off * async threads off * threads off * fix ci * restore option * make CI pleased * fix ic tests * Update config.nims * add changelog * Update changelog.md Co-authored-by: konsumlamm <[email protected]> Co-authored-by: konsumlamm <[email protected]>
1 parent af13626 commit 276c250

File tree

10 files changed

+17
-9
lines changed

10 files changed

+17
-9
lines changed

changelog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ becomes an alias for `addr`.
2626

2727
- The `gc:v2` option is removed.
2828

29+
- The `threads:on` option becomes the default.
30+
2931
## Standard library additions and changes
3032

3133
[//]: # "Changes:"

config/nim.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ cc = gcc
1717
hint[LineTooLong]=off
1818
#hint[XDeclaredButNotUsed]=off
1919

20+
threads:on
21+
2022
# Examples of how to setup a cross-compiler:
2123
# Nim can target architectures and OSes different than the local host
2224
# Syntax: <arch>.<os>.gcc.exe = "<compiler executable>"

testament/categories.nim

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ proc runBasicDLLTest(c, r: var TResults, cat: Category, options: string) =
5959
var test2 = makeTest("tests/dll/server.nim", options & " --threads:on" & rpath, cat)
6060
test2.spec.action = actionCompile
6161
testSpec c, test2
62-
var test3 = makeTest("lib/nimhcr.nim", options & " --outdir:tests/dll" & rpath, cat)
62+
var test3 = makeTest("lib/nimhcr.nim", options & " --threads:off --outdir:tests/dll" & rpath, cat)
6363
test3.spec.action = actionCompile
6464
testSpec c, test3
65-
var test4 = makeTest("tests/dll/visibility.nim", options & " --app:lib" & rpath, cat)
65+
var test4 = makeTest("tests/dll/visibility.nim", options & " --threads:off --app:lib" & rpath, cat)
6666
test4.spec.action = actionCompile
6767
testSpec c, test4
6868

@@ -77,13 +77,13 @@ proc runBasicDLLTest(c, r: var TResults, cat: Category, options: string) =
7777
defer: putEnv(libpathenv, libpath)
7878

7979
testSpec r, makeTest("tests/dll/client.nim", options & " --threads:on" & rpath, cat)
80-
testSpec r, makeTest("tests/dll/nimhcr_unit.nim", options & rpath, cat)
81-
testSpec r, makeTest("tests/dll/visibility.nim", options & rpath, cat)
80+
testSpec r, makeTest("tests/dll/nimhcr_unit.nim", options & " --threads:off" & rpath, cat)
81+
testSpec r, makeTest("tests/dll/visibility.nim", options & " --threads:off" & rpath, cat)
8282

8383
if "boehm" notin options:
8484
# force build required - see the comments in the .nim file for more details
8585
var hcri = makeTest("tests/dll/nimhcr_integration.nim",
86-
options & " --forceBuild --hotCodeReloading:on" & rpath, cat)
86+
options & " --threads:off --forceBuild --hotCodeReloading:on" & rpath, cat)
8787
let nimcache = nimcacheDir(hcri.name, hcri.options, getTestSpecTarget())
8888
let cmd = prepareTestCmd(hcri.spec.getCmd, hcri.name,
8989
hcri.options, nimcache, getTestSpecTarget())

tests/avr/thello.nim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
discard """
2-
cmd: "nim c --compileOnly --os:standalone --exceptions:quirky -d:noSignalHandler -d:danger $file"
2+
cmd: "nim c --compileOnly --os:standalone --exceptions:quirky -d:noSignalHandler -d:danger --threads:off $file"
33
action: "compile"
44
"""
55

tests/destructor/trecursive.nim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ proc `=destroy`(x: var MyObject) =
4747
proc `=`(x: var MyObject, y: MyObject) {.error.}
4848

4949
proc newMyObject(i: int): MyObject =
50-
result.p = create(int)
50+
result.p = createShared(int)
5151
result.p[] = i
5252

5353
proc test: seq[MyObject] =

tests/ic/config.nims

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
when defined(windows):
2+
--threads:off

tests/manyloc/standalone2/tavr.nim.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
--cpu:avr
33
--os:standalone
44
--compileOnly
5+
--threads:off

tests/niminaction/Chapter7/Tweeter/src/tweeter.nim

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
discard """
22
action: compile
3+
matrix: "--threads:off"
34
"""
45

56
import asyncdispatch, times

tests/stdlib/ttasks.nim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
discard """
22
targets: "c cpp"
3-
matrix: "--gc:orc"
3+
matrix: "--gc:orc --threads:off"
44
"""
55

66
import std/[tasks, strformat]

tests/system/tgcnone.nim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
discard """
2-
matrix: "--gc:none -d:useMalloc"
2+
matrix: "--gc:none -d:useMalloc --threads:off"
33
"""
44
# bug #15617
55
let x = 4

0 commit comments

Comments
 (0)