From 014d903b4f327fecf0943ed327a8de8f5332b495 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Thu, 10 Mar 2011 11:05:39 +0000 Subject: [PATCH] iallows threads to start --- C/init.c | 3 --- C/threads.c | 2 ++ 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/C/init.c b/C/init.c index 657807f4b..9fffbb4b7 100755 --- a/C/init.c +++ b/C/init.c @@ -1244,9 +1244,6 @@ InitCodes(void) int wid; #include "ihstruct.h" InitGlobal(); - for (wid = 0; wid < MAX_INITS; wid++) { - InitWorker(wid); - } InitFirstWorkerThreadHandle(); /* make sure no one else can use these two atoms */ CurrentModule = 0; diff --git a/C/threads.c b/C/threads.c index c90f7ee44..581228cf4 100755 --- a/C/threads.c +++ b/C/threads.c @@ -165,6 +165,7 @@ setup_engine(int myworker_id, int init_thread) REGSTORE *standard_regs; standard_regs = (REGSTORE *)calloc(1,sizeof(REGSTORE)); + regcache = standard_regs; /* create the YAAM descriptor */ FOREIGN_ThreadHandle(myworker_id).default_yaam_regs = standard_regs; if (init_thread) { @@ -200,6 +201,7 @@ thread_run(void *widp) int myworker_id = *((int *)widp); start_thread(myworker_id); + regcache = ((REGSTORE *)pthread_getspecific(Yap_yaamregs_key)); do { t = tgs[0] = Yap_PopTermFromDB(MY_ThreadHandle.tgoal); if (t == 0) {