From dd7ebb2c95a47745c12a9bb8274b2362f96afea1 Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Sun, 2 Apr 2017 16:48:23 -0500 Subject: [PATCH] fixup! support for the Genode OS framework (#5653) Allocate thread metadata at createThread. --- lib/genode_cpp/threads.h | 1 - lib/system/threads.nim | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/genode_cpp/threads.h b/lib/genode_cpp/threads.h index a1cd61cd2c..043f808f10 100644 --- a/lib/genode_cpp/threads.h +++ b/lib/genode_cpp/threads.h @@ -13,7 +13,6 @@ #define _GENODE_CPP__THREAD_H_ #include -#include #include namespace Nim { struct SysThread; } diff --git a/lib/system/threads.nim b/lib/system/threads.nim index 4855a2b93f..7743fffff5 100644 --- a/lib/system/threads.nim +++ b/lib/system/threads.nim @@ -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