fixup! support for the Genode OS framework (#5653)
Allocate thread metadata at createThread.
This commit is contained in:
parent
cab2ce7e87
commit
dd7ebb2c95
2 changed files with 2 additions and 1 deletions
|
|
@ -13,7 +13,6 @@
|
||||||
#define _GENODE_CPP__THREAD_H_
|
#define _GENODE_CPP__THREAD_H_
|
||||||
|
|
||||||
#include <base/thread.h>
|
#include <base/thread.h>
|
||||||
#include <util/avl_tree.h>
|
|
||||||
#include <util/reconstructible.h>
|
#include <util/reconstructible.h>
|
||||||
|
|
||||||
namespace Nim { struct SysThread; }
|
namespace Nim { struct SysThread; }
|
||||||
|
|
|
||||||
|
|
@ -593,6 +593,8 @@ elif defined(genode):
|
||||||
proc createThread*[TArg](t: var Thread[TArg],
|
proc createThread*[TArg](t: var Thread[TArg],
|
||||||
tp: proc (arg: TArg) {.thread, nimcall.},
|
tp: proc (arg: TArg) {.thread, nimcall.},
|
||||||
param: TArg) =
|
param: TArg) =
|
||||||
|
t.core = cast[PGcThread](allocShared0(sizeof(GcThread)))
|
||||||
|
|
||||||
when TArg isnot void: t.data = param
|
when TArg isnot void: t.data = param
|
||||||
t.dataFn = tp
|
t.dataFn = tp
|
||||||
when hasSharedHeap: t.stackSize = ThreadStackSize
|
when hasSharedHeap: t.stackSize = ThreadStackSize
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue