init_yapor_workers -> Yap_init_yapor_workers

This commit is contained in:
Ricardo Rocha 2011-06-01 18:51:12 +01:00
parent 1962a0507f
commit dfe0e1854f
5 changed files with 14 additions and 14 deletions

View File

@ -2727,14 +2727,12 @@ YAP_Init(YAP_init_args *yap_init)
CELL Trail = 0, Stack = 0, Heap = 0, Atts = 0; CELL Trail = 0, Stack = 0, Heap = 0, Atts = 0;
static char boot_file[256]; static char boot_file[256];
Yap_InitPageSize(); Yap_InitPageSize(); /* init memory page size, required by later functions */
//Yap_InitSysbits();
#if defined(YAPOR_COPY) || defined(YAPOR_COW) || defined(YAPOR_SBA) #if defined(YAPOR_COPY) || defined(YAPOR_COW) || defined(YAPOR_SBA)
Yap_init_yapor_global_local_memory(); Yap_init_yapor_global_local_memory();
LOCAL = REMOTE(0); LOCAL = REMOTE(0);
#endif /* YAPOR_COPY || YAPOR_COW || YAPOR_SBA */ #endif /* YAPOR_COPY || YAPOR_COW || YAPOR_SBA */
/* Init signal handling, time and memory page size, required by later functions */ Yap_InitSysbits(); /* init signal handling and time, required by later functions */
Yap_InitSysbits();
GLOBAL_argv = yap_init->Argv; GLOBAL_argv = yap_init->Argv;
GLOBAL_argc = yap_init->Argc; GLOBAL_argc = yap_init->Argc;
#if !BOOT_FROM_SAVED_STATE #if !BOOT_FROM_SAVED_STATE
@ -2850,10 +2848,10 @@ YAP_Init(YAP_init_args *yap_init)
} }
yap_flags[FAST_BOOT_FLAG] = yap_init->FastBoot; yap_flags[FAST_BOOT_FLAG] = yap_init->FastBoot;
#if defined(YAPOR) || defined(TABLING) #if defined(YAPOR) || defined(TABLING)
Yap_init_root_frames(); Yap_init_root_frames();
#endif /* YAPOR || TABLING */ #endif /* YAPOR || TABLING */
#ifdef YAPOR #ifdef YAPOR
init_yapor_workers(); Yap_init_yapor_workers();
if (worker_id != 0) { if (worker_id != 0) {
#if defined(YAPOR_COPY) || defined(YAPOR_SBA) #if defined(YAPOR_COPY) || defined(YAPOR_SBA)
/* /*

View File

@ -1060,7 +1060,7 @@ InitInvisibleAtoms(void)
#ifdef YAPOR #ifdef YAPOR
void init_yapor_workers(void) { void Yap_init_yapor_workers(void) {
CACHE_REGS CACHE_REGS
int proc; int proc;
#ifdef YAPOR_THREADS #ifdef YAPOR_THREADS
@ -1071,7 +1071,7 @@ void init_yapor_workers(void) {
int son; int son;
son = fork(); son = fork();
if (son == -1) if (son == -1)
Yap_Error(FATAL_ERROR, TermNil, "fork error (init_yapor_workers)"); Yap_Error(FATAL_ERROR, TermNil, "fork error (Yap_init_yapor_workers)");
if (son > 0) { if (son > 0) {
/* I am the father, I must stay here and wait for my children to all die */ /* I am the father, I must stay here and wait for my children to all die */
struct sigaction sigact; struct sigaction sigact;
@ -1091,7 +1091,7 @@ void init_yapor_workers(void) {
int son; int son;
son = fork(); son = fork();
if (son == -1) if (son == -1)
Yap_Error(FATAL_ERROR, TermNil, "fork error (init_yapor_workers)"); Yap_Error(FATAL_ERROR, TermNil, "fork error (Yap_init_yapor_workers)");
if (son == 0) { if (son == 0) {
/* new worker */ /* new worker */
worker_id = proc; worker_id = proc;
@ -1249,8 +1249,6 @@ Yap_InitWorkspace(UInt Heap, UInt Stack, UInt Trail, UInt Atts, UInt max_table_s
return; return;
pthread_key_create(&Yap_yaamregs_key, NULL); pthread_key_create(&Yap_yaamregs_key, NULL);
pthread_setspecific(Yap_yaamregs_key, (const void *)&Yap_standard_regs); pthread_setspecific(Yap_yaamregs_key, (const void *)&Yap_standard_regs);
//printf(" -> -> %p \n", &Yap_REGS);
//LOCAL = REMOTE(0);
GLOBAL_master_thread = pthread_self(); GLOBAL_master_thread = pthread_self();
#else #else
/* In this case we need to initialise the abstract registers */ /* In this case we need to initialise the abstract registers */

View File

@ -237,7 +237,7 @@ void STD_PROTO(Yap_InitCPredBack_,(char *, unsigned long int, unsigned int, C
void STD_PROTO(Yap_InitWorkspace,(UInt,UInt,UInt,UInt,UInt,int,int,int)); void STD_PROTO(Yap_InitWorkspace,(UInt,UInt,UInt,UInt,UInt,int,int,int));
#ifdef YAPOR #ifdef YAPOR
void STD_PROTO(init_yapor_workers, (void)); void STD_PROTO(Yap_init_yapor_workers, (void));
#endif /* YAPOR */ #endif /* YAPOR */
#if defined(YAPOR) || defined(THREADS) #if defined(YAPOR) || defined(THREADS)
void STD_PROTO(Yap_KillStacks,(int)); void STD_PROTO(Yap_KillStacks,(int));

View File

@ -21,9 +21,13 @@
#include "YapHeap.h" #include "YapHeap.h"
#include "SWI-Prolog.h" #include "SWI-Prolog.h"
#ifdef YAPOR #ifdef YAPOR
#if HAVE_STRING_H
#include <string.h>
#endif /* HAVE_STRING_H */
#if HAVE_SYS_TIME_H #if HAVE_SYS_TIME_H
#include <sys/time.h> #include <sys/time.h>
#endif /* HAVE_SYS_TIME_H */ #endif /* HAVE_SYS_TIME_H */
#include "yapio.h"
#include "or.macros.h" #include "or.macros.h"
#endif /* YAPOR */ #endif /* YAPOR */
#ifdef TABLING #ifdef TABLING

View File

@ -87,9 +87,9 @@ void resume_suspension_frame(susp_fr_ptr, or_fr_ptr);
/************************** /*******************************
** or.copy_engine.c ** ** or.copy_engine.c **
**************************/ *******************************/
#ifdef YAPOR #ifdef YAPOR
void make_root_choice_point(void); void make_root_choice_point(void);