put std/threads under the umbrella of nimPreviewSlimSystem (#20711)

* put `std/threads` under the umbrella of `nimPreviewSlimSystem`

* add changelog

* fixes tests

* fixes tests again

* fixes tests
This commit is contained in:
ringabout 2022-10-31 13:36:50 +08:00 • committed by GitHub
commit e1ddd2d524
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 33 additions and 19 deletions

View file

@ -8,6 +8,9 @@ discard """
import std/atomics
when defined(nimPreviewSlimSystem):
import std/[assertions, threads]
const MemBlockSize = 256
type

View file

@ -7,7 +7,10 @@ discard """
import std/envvars
from std/sequtils import toSeq
import stdtest/testutils
import std/assertions
import std/[assertions]
when not defined(js):
import std/threads
# "LATIN CAPITAL LETTER AE" in UTF-8 (0xc386)
const unicodeUtf8 = "\xc3\x86"

View file

@ -5,7 +5,7 @@ discard """
"""
import os, net, nativesockets, asyncdispatch
import std/[assertions]
import std/[assertions, threads]
## Test for net.dial

View file

@ -7,7 +7,9 @@ discard """
import std/os
from std/sequtils import toSeq
import stdtest/testutils
import std/assertions
when defined(nimPreviewSlimSystem):
import std/[assertions]
# "LATIN CAPITAL LETTER AE" in UTF-8 (0xc386)
const unicodeUtf8 = "\xc3\x86"
@ -55,6 +57,8 @@ when defined(windows):
proc c_getenv(env: cstring): cstring {.importc: "getenv", header: "<stdlib.h>".}
when not defined(js) and not defined(nimscript):
when defined(nimPreviewSlimSystem):
import std/threads
block: # bug #18533
var thr: Thread[void]
proc threadFunc {.thread.} = putEnv("foo", "fooVal2")

View file

@ -4,7 +4,7 @@ discard """
disabled: "openbsd"
"""
# disabled: pending bug #15713
import std/[net, nativesockets, assertions]
import std/[net, nativesockets, assertions, threads]
when defined(posix): import os, posix
else:

View file

@ -10,6 +10,7 @@ Crashes before getting here!
"""
import std/os
import std/threads
proc whatever() {.thread, nimcall.} =
echo("TEST")