iallows threads to start

This commit is contained in:
Vítor Santos Costa 2011-03-10 11:05:39 +00:00
parent 4b8a9a4f4e
commit 014d903b4f
2 changed files with 2 additions and 3 deletions

View File

@ -1244,9 +1244,6 @@ InitCodes(void)
int wid; int wid;
#include "ihstruct.h" #include "ihstruct.h"
InitGlobal(); InitGlobal();
for (wid = 0; wid < MAX_INITS; wid++) {
InitWorker(wid);
}
InitFirstWorkerThreadHandle(); InitFirstWorkerThreadHandle();
/* make sure no one else can use these two atoms */ /* make sure no one else can use these two atoms */
CurrentModule = 0; CurrentModule = 0;

View File

@ -165,6 +165,7 @@ setup_engine(int myworker_id, int init_thread)
REGSTORE *standard_regs; REGSTORE *standard_regs;
standard_regs = (REGSTORE *)calloc(1,sizeof(REGSTORE)); standard_regs = (REGSTORE *)calloc(1,sizeof(REGSTORE));
regcache = standard_regs;
/* create the YAAM descriptor */ /* create the YAAM descriptor */
FOREIGN_ThreadHandle(myworker_id).default_yaam_regs = standard_regs; FOREIGN_ThreadHandle(myworker_id).default_yaam_regs = standard_regs;
if (init_thread) { if (init_thread) {
@ -200,6 +201,7 @@ thread_run(void *widp)
int myworker_id = *((int *)widp); int myworker_id = *((int *)widp);
start_thread(myworker_id); start_thread(myworker_id);
regcache = ((REGSTORE *)pthread_getspecific(Yap_yaamregs_key));
do { do {
t = tgs[0] = Yap_PopTermFromDB(MY_ThreadHandle.tgoal); t = tgs[0] = Yap_PopTermFromDB(MY_ThreadHandle.tgoal);
if (t == 0) { if (t == 0) {