summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorEmery Hemingway <githubjunk@spam.works>2017-04-02 16:48:23 -0500
committerAndreas Rumpf <rumpf_a@web.de>2017-04-02 23:48:23 +0200
commitdd7ebb2c95a47745c12a9bb8274b2362f96afea1 (patch)
tree0f114592e4bd380dccc851cf493ace8ad0377009
parentcab2ce7e8770f35561f002bab601358a09535ef2 (diff)
downloadNim-dd7ebb2c95a47745c12a9bb8274b2362f96afea1.tar.gz
fixup! support for the Genode OS framework (#5653)
Allocate thread metadata at createThread.
-rw-r--r--lib/genode_cpp/threads.h1
-rw-r--r--lib/system/threads.nim2
2 files changed, 2 insertions, 1 deletions
diff --git a/lib/genode_cpp/threads.h b/lib/genode_cpp/threads.h
index a1cd61cd2..043f808f1 100644
--- a/lib/genode_cpp/threads.h
+++ b/lib/genode_cpp/threads.h
@@ -13,7 +13,6 @@
 #define _GENODE_CPP__THREAD_H_
 
 #include <base/thread.h>
-#include <util/avl_tree.h>
 #include <util/reconstructible.h>
 
 namespace Nim { struct SysThread; }
diff --git a/lib/system/threads.nim b/lib/system/threads.nim
index 4855a2b93..7743fffff 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