aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDavid Walter Seikel2014-08-10 04:21:24 +1000
committerDavid Walter Seikel2014-08-10 04:21:24 +1000
commit12ab4c4aaf9c6e4037a0ffb88b2e8615cbc4d830 (patch)
tree2dd16cd4526fab525ec4d127181d9a1c565e07d3
parentQuick and dirty crashing compiler catcher. (diff)
downloadSledjHamr-12ab4c4aaf9c6e4037a0ffb88b2e8615cbc4d830.zip
SledjHamr-12ab4c4aaf9c6e4037a0ffb88b2e8615cbc4d830.tar.gz
SledjHamr-12ab4c4aaf9c6e4037a0ffb88b2e8615cbc4d830.tar.bz2
SledjHamr-12ab4c4aaf9c6e4037a0ffb88b2e8615cbc4d830.tar.xz
Thread all of compiling, or thread nothing.
-rw-r--r--src/LuaSL/LuaSL.h1
-rw-r--r--src/LuaSL/LuaSL_LSL_tree.h1
-rw-r--r--src/LuaSL/LuaSL_compile.c4
-rw-r--r--src/libraries/Runnr.c12
-rw-r--r--src/libraries/Runnr.h2
5 files changed, 12 insertions, 8 deletions
diff --git a/src/LuaSL/LuaSL.h b/src/LuaSL/LuaSL.h
index f696f03..54e7fa7 100644
--- a/src/LuaSL/LuaSL.h
+++ b/src/LuaSL/LuaSL.h
@@ -12,7 +12,6 @@ typedef struct _gameGlobals gameGlobals; // Define this here, so LuaSL_threads.h
12#include "LumbrJack.h" 12#include "LumbrJack.h"
13#include "Runnr.h" 13#include "Runnr.h"
14 14
15#define COMPILE_THREADED 0
16 15
17struct _gameGlobals 16struct _gameGlobals
18{ 17{
diff --git a/src/LuaSL/LuaSL_LSL_tree.h b/src/LuaSL/LuaSL_LSL_tree.h
index 30a12f5..5b61926 100644
--- a/src/LuaSL/LuaSL_LSL_tree.h
+++ b/src/LuaSL/LuaSL_LSL_tree.h
@@ -3,6 +3,7 @@
3#define __LUASL_TREE_H__ 3#define __LUASL_TREE_H__
4 4
5#define LUASL_DEBUG 0 5#define LUASL_DEBUG 0
6#define COMPILE_THREADED 0
6#define LUASL_DIFF_CHECK 0 7#define LUASL_DIFF_CHECK 0
7#define LUASL_BAD_CHECK 0 8#define LUASL_BAD_CHECK 0
8 9
diff --git a/src/LuaSL/LuaSL_compile.c b/src/LuaSL/LuaSL_compile.c
index 5da2724..286681e 100644
--- a/src/LuaSL/LuaSL_compile.c
+++ b/src/LuaSL/LuaSL_compile.c
@@ -2373,9 +2373,7 @@ boolean compileLSL(LuaSL_compiler *compiler)
2373 // Compile the Lua source code. 2373 // Compile the Lua source code.
2374 compiler->compiler.luaName = strdup(luaName); 2374 compiler->compiler.luaName = strdup(luaName);
2375 compiler->compiler.bugCount = compiler->script.bugCount; 2375 compiler->compiler.bugCount = compiler->script.bugCount;
2376#if !COMPILE_THREADED 2376 compileScript(&compiler->compiler, COMPILE_THREADED);
2377 compileScript(&compiler->compiler);
2378#endif
2379 compiler->result = TRUE; 2377 compiler->result = TRUE;
2380 } 2378 }
2381 else 2379 else
diff --git a/src/libraries/Runnr.c b/src/libraries/Runnr.c
index 366c31a..e97fcee 100644
--- a/src/libraries/Runnr.c
+++ b/src/libraries/Runnr.c
@@ -471,12 +471,18 @@ static void _compileThread(void *data, Ecore_Thread *thread)
471 printf("Can't create a new Lua state!\n"); 471 printf("Can't create a new Lua state!\n");
472 } 472 }
473 473
474 ecore_thread_feedback(thread, compiler); 474 if (thread)
475 ecore_thread_feedback(thread, compiler);
476 else
477 _compileNotify(compiler, thread, NULL);
475} 478}
476 479
477void compileScript(LuaCompiler *compiler) 480void compileScript(LuaCompiler *compiler, int threadIt)
478{ 481{
479 ecore_thread_feedback_run(_compileThread, _compileNotify, NULL, NULL, compiler, EINA_FALSE); 482 if (threadIt)
483 ecore_thread_feedback_run(_compileThread, _compileNotify, NULL, NULL, compiler, EINA_FALSE);
484 else
485 _compileThread(compiler, NULL);
480} 486}
481 487
482// Assumes the scripts mutex is taken already. 488// Assumes the scripts mutex is taken already.
diff --git a/src/libraries/Runnr.h b/src/libraries/Runnr.h
index f5f6960..8837eed 100644
--- a/src/libraries/Runnr.h
+++ b/src/libraries/Runnr.h
@@ -74,7 +74,7 @@ typedef struct
74 74
75 75
76script *scriptAdd(char *file, char *SID, RunnrServerCb send2server, void *data); 76script *scriptAdd(char *file, char *SID, RunnrServerCb send2server, void *data);
77void compileScript(LuaCompiler *compiler); 77void compileScript(LuaCompiler *compiler, int threadIt);
78void runScript(script *me); 78void runScript(script *me);
79void resetScript(script *me); 79void resetScript(script *me);
80script *getScript(char *SID); 80script *getScript(char *SID);