Fix termination conditions for failed and detached threads.

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1654 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc
2006-05-25 16:57:21 +00:00
parent f5b9000018
commit 1d445a731d
2 changed files with 14 additions and 7 deletions

View File

@@ -143,14 +143,13 @@ thread_run(void *widp)
{
Term tgoal;
Term tgs[2];
int out;
int myworker_id = *((int *)widp);
start_thread(myworker_id);
tgs[0] = Yap_FetchTermFromDB(ThreadHandle[worker_id].tgoal);
tgs[1] = ThreadHandle[worker_id].tdetach;
tgoal = Yap_MkApplTerm(FunctorThreadRun, 2, tgs);
out = Yap_RunTopGoal(tgoal);
Yap_RunTopGoal(tgoal);
thread_die(worker_id, FALSE);
return NULL;
}