diff --git a/H/dglobals.h b/H/dglobals.h index 5e1cec8e9..ea87f54dd 100644 --- a/H/dglobals.h +++ b/H/dglobals.h @@ -145,6 +145,7 @@ #define putc_cur_buf WL->putc_cur_buf_ #define putc_cur_lim WL->putc_cur_lim_ #define putc_cur_flags WL->putc_cur_flags_ +#define execution WL->_execution #if (defined(YAPOR) || defined(TABLING)) && defined(THREADS) #define WORKER WL->worker diff --git a/H/hglobals.h b/H/hglobals.h index 50a5205b0..622f16d7b 100644 --- a/H/hglobals.h +++ b/H/hglobals.h @@ -147,6 +147,7 @@ typedef struct worker_local { char* putc_cur_buf_; char* putc_cur_lim_; UInt putc_cur_flags_; + struct open_query_struct* _execution; #if (defined(YAPOR) || defined(TABLING)) && defined(THREADS) struct worker worker; diff --git a/H/iglobals.h b/H/iglobals.h index 53fd05230..8bdee9d02 100644 --- a/H/iglobals.h +++ b/H/iglobals.h @@ -145,6 +145,7 @@ static void InitWorker(int wid) { FOREIGN_WL(wid)->putc_cur_buf_ = NULL; FOREIGN_WL(wid)->putc_cur_lim_ = NULL; FOREIGN_WL(wid)->putc_cur_flags_ = 0L; + FOREIGN_WL(wid)->_execution = NULL; #if (defined(YAPOR) || defined(TABLING)) && defined(THREADS) diff --git a/H/rglobals.h b/H/rglobals.h index 3e2877ccc..75a8858ed 100644 --- a/H/rglobals.h +++ b/H/rglobals.h @@ -146,6 +146,7 @@ static void RestoreWorker(int wid) { + #if (defined(YAPOR) || defined(TABLING)) && defined(THREADS) #endif diff --git a/library/yap2swi/Makefile.in b/library/yap2swi/Makefile.in index 121fc213c..f8dfc0696 100644 --- a/library/yap2swi/Makefile.in +++ b/library/yap2swi/Makefile.in @@ -35,7 +35,7 @@ CWD=$(PWD) # OBJS=yap2swi.o -SOBJS=yap2swi@SHLIB_SUFFIX@ +SOBJS=yap2swi.@SHLIB_SUFFIX@ #in some systems we just create a single object, in others we need to # create a libray @@ -47,11 +47,11 @@ all: yap2swi.o: $(srcdir)/yap2swi.c $(srcdir)/yap2swi.h $(CC) -c $(CFLAGS) $(SHLIB_CFLAGS) $(srcdir)/yap2swi.c -o yap2swi.o -@DO_SECOND_LD@@DO_SECOND_LD@%@SHLIB_SUFFIX@: %.o +@DO_SECOND_LD@@DO_SECOND_LD@%.@SHLIB_SUFFIX@: %.o @DO_SECOND_LD@ @SHLIB_LD@ -o $@ $< -@DO_SECOND_LD@yap2swi@SHLIB_SUFFIX@: yap2swi.o -@DO_SECOND_LD@ @SHLIB_LD@ -o yap2swi@SHLIB_SUFFIX@ yap2swi.o @ +@DO_SECOND_LD@yap2swi.@SHLIB_SUFFIX@: yap2swi.o +@DO_SECOND_LD@ @SHLIB_LD@ -o yap2swi.@SHLIB_SUFFIX@ yap2swi.o @ install: $(INSTALL_PROGRAM) $(SOBJS) $(DESTDIR)$(LIBDIR) diff --git a/library/yap2swi/yap2swi.c b/library/yap2swi/yap2swi.c index f1394cb82..4c862f097 100755 --- a/library/yap2swi/yap2swi.c +++ b/library/yap2swi/yap2swi.c @@ -2358,8 +2358,6 @@ typedef struct open_query_struct { struct open_query_struct *old; } open_query; -static open_query *execution = NULL; - X_API fid_t PL_open_foreign_frame(void) { @@ -2564,6 +2562,7 @@ X_API int PL_thread_self(void) X_API int PL_thread_attach_engine(const PL_thread_attr_t *attr) { int wid = YAP_ThreadSelf(); + fprintf(stderr,"attaching new engine %p\n", attr); if (wid < 0) { /* we do not have an engine */ @@ -2623,7 +2622,7 @@ PL_create_engine(const PL_thread_attr_t *attr) yapt.tsize = attr->global_size; yapt.alias = (YAP_Term)attr->alias; yapt.cancel = attr->cancel; - return (PL_engine_t)YAP_ThreadCreateEngine(&yapt); + return (PL_engine_t)YAP_ThreadCreateEngine(&yapt); } else { return (PL_engine_t)YAP_ThreadCreateEngine(NULL); } diff --git a/misc/GLOBALS b/misc/GLOBALS index da5f07534..8c044f889 100644 --- a/misc/GLOBALS +++ b/misc/GLOBALS @@ -159,6 +159,8 @@ char* putc_cur_buf_ putc_cur_buf =NULL char* putc_cur_lim_ putc_cur_lim =NULL UInt putc_cur_flags_ putc_cur_flags =0L +struct open_query_struct* _execution execution =NULL + // Ricardo's stuff #if (defined(YAPOR) || defined(TABLING)) && defined(THREADS) struct worker worker WORKER void @@ -169,6 +171,7 @@ struct thandle thread_handle ThreadHandle InitThreadHandle #define FOREIGN_ThreadHandle(wid) (Yap_WLocal[(wid)].thread_handle) #define MY_ThreadHandle (Yap_WLocal[worker_id].thread_handle) #endif + // END WORKER LOCAL STUFF END_WORKER_LOCAL