move threads out of system (#20674)

* move syslocks first

* progress

* clean up

* go on

* clean up

* clean up

* add imports syslocks

* remove documentation

* public deallocOsPages

* fixes genode

* fixes more

* fixes boehmGC

* cover more cases

* fixes cyclic deps

* fixes genode

* cleanup

* unpublic fields

* cleanup

* clean up
This commit is contained in:
ringabout 2022-10-30 00:11:40 +08:00 • committed by GitHub
commit 1dab8ba334
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 424 additions and 390 deletions

View file

@ -1115,7 +1115,7 @@ elif defined(nimdoc):
proc quit*(errorcode: int = QuitSuccess) {.magic: "Exit", noreturn.}
elif defined(genode):
include genode/env
import genode/env
var systemEnv {.exportc: runtimeEnvSym.}: GenodeEnvPtr
@ -1609,8 +1609,7 @@ when notJSnotNims:
{.push stackTrace: off.}
when not defined(js) and hasThreadSupport and hostOS != "standalone":
const insideRLocksModule = false
include "system/syslocks"
import std/private/syslocks
include "system/threadlocalstorage"
when not defined(js) and defined(nimV2):
@ -2092,7 +2091,12 @@ when not defined(js):
when declared(initAllocator):
initAllocator()
when hasThreadSupport:
when hostOS != "standalone": include "system/threads"
when hostOS != "standalone":
include system/threadimpl
import std/threads
export threads
elif not defined(nogc) and not defined(nimscript):
when not defined(useNimRtl) and not defined(createNimRtl): initStackBottom()
when declared(initGC): initGC()