From 4f6d13e8c05754c0c2cecc35e13abc9125db119a Mon Sep 17 00:00:00 2001 From: pmoura Date: Wed, 24 May 2006 21:41:00 +0000 Subject: [PATCH] Add thread_create/2 predicate (same as thread_create/3 using default options). git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1651 b08c6af1-5177-4d33-ba66-4b1c6b8b522a --- pl/threads.yap | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pl/threads.yap b/pl/threads.yap index 93349d6aa..aca610f54 100644 --- a/pl/threads.yap +++ b/pl/threads.yap @@ -50,6 +50,14 @@ recorda('$thread_exit_status', [Id0|exception(Exception)], _), '$run_at_thread_exit'(Id0). +thread_create(Goal, Id) :- + '$check_callable'(Goal, thread_create(Goal, Id)), + recorded('$thread_defaults', [Stack, Trail, System], _), + '$thread_new_tid'(Id), + '$clean_db_on_id'(Id), + '$create_mq'(Id), + '$create_thread'(Goal, Stack, Trail, System, _, Id). + thread_create(Goal, Id, Options) :- G0 = thread_create(Goal, Id, Options), '$check_callable'(Goal,G0),