From 12ab4c4aaf9c6e4037a0ffb88b2e8615cbc4d830 Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Sun, 10 Aug 2014 04:21:24 +1000 Subject: Thread all of compiling, or thread nothing. --- src/libraries/Runnr.c | 12 +++++++++--- src/libraries/Runnr.h | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'src/libraries') 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) printf("Can't create a new Lua state!\n"); } - ecore_thread_feedback(thread, compiler); + if (thread) + ecore_thread_feedback(thread, compiler); + else + _compileNotify(compiler, thread, NULL); } -void compileScript(LuaCompiler *compiler) +void compileScript(LuaCompiler *compiler, int threadIt) { - ecore_thread_feedback_run(_compileThread, _compileNotify, NULL, NULL, compiler, EINA_FALSE); + if (threadIt) + ecore_thread_feedback_run(_compileThread, _compileNotify, NULL, NULL, compiler, EINA_FALSE); + else + _compileThread(compiler, NULL); } // 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 script *scriptAdd(char *file, char *SID, RunnrServerCb send2server, void *data); -void compileScript(LuaCompiler *compiler); +void compileScript(LuaCompiler *compiler, int threadIt); void runScript(script *me); void resetScript(script *me); script *getScript(char *SID); -- cgit v1.1