fixup! support for the Genode OS framework (#5653)

Allocate thread metadata at createThread.
This commit is contained in:
Emery Hemingway 2017-04-02 16:48:23 -05:00 • committed by Andreas Rumpf
commit dd7ebb2c95
2 changed files with 2 additions and 1 deletions

View file

@ -593,6 +593,8 @@ elif defined(genode):
proc createThread*[TArg](t: var Thread[TArg],
tp: proc (arg: TArg) {.thread, nimcall.},
param: TArg) =
t.core = cast[PGcThread](allocShared0(sizeof(GcThread)))
when TArg isnot void: t.data = param
t.dataFn = tp
when hasSharedHeap: t.stackSize = ThreadStackSize