Added new flag "max_workers". It uses a C function, "p_max_workers" that is currently defined in the *wrong* place ("threads.c").

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@2193 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
pmoura
2008-04-02 22:59:52 +00:00
parent 1c7681b179
commit 48e8101a87
3 changed files with 24 additions and 1 deletions

View File

@@ -645,6 +645,12 @@ p_nof_threads(void)
return Yap_unify(ARG1,MkIntegerTerm(i));
}
static Int
p_max_workers(void)
{ /* '$max_workers'(+P) */
return Yap_unify(ARG1,MkIntegerTerm(MAX_WORKERS));
}
static Int
p_max_threads(void)
{ /* '$max_threads'(+P) */
@@ -666,6 +672,7 @@ p_thread_runtime(void)
void Yap_InitThreadPreds(void)
{
Yap_InitCPred("$no_threads", 0, p_no_threads, HiddenPredFlag);
Yap_InitCPred("$max_workers", 1, p_max_workers, HiddenPredFlag);
Yap_InitCPred("$max_threads", 1, p_max_threads, HiddenPredFlag);
Yap_InitCPred("$thread_new_tid", 1, p_thread_new_tid, HiddenPredFlag);
Yap_InitCPred("$create_thread", 6, p_create_thread, HiddenPredFlag);