From 28de20262f843a87dca83c824cfd6c7378b4b418 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Wed, 4 Aug 2010 11:35:30 +0100 Subject: [PATCH] initialise *all* threads. support SWI buffers. --- C/init.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/C/init.c b/C/init.c index 4c32dac0d..272a9fa95 100755 --- a/C/init.c +++ b/C/init.c @@ -1148,6 +1148,20 @@ InitThreadHandle(int wid) } #endif +static void +InitSWIBuffers(int wid) +{ + int i; + + FOREIGN_WL(wid)->SWI_buffers_[0] = malloc(SWI_BUF_SIZE); + FOREIGN_WL(wid)->SWI_buffers_sz_[0] = SWI_BUF_SIZE; + for (i=1; i <= SWI_BUF_RINGS; i++) { + FOREIGN_WL(wid)->SWI_buffers_[i] = NULL; + FOREIGN_WL(wid)->SWI_buffers_sz_[i] = 0; + } +} + + static void InitFirstWorkerThreadHandle(void) { @@ -1182,7 +1196,7 @@ Yap_CloseScratchPad(void) #include "iglobals.h" #if defined(YAPOR) || defined(THREADS) -#define MAX_INITS 1 +#define MAX_INITS MAX_WORKERS #else #define MAX_INITS 1 #endif