CLuaInstance: Add linux pthread support

- code ported from lua-llthreads2
   (https://github.com/moteus/lua-llthreads2)
 - code in neutrino integrated for use of lua neutrino api in threads
 - add thread::cancel() function

 - Set Lua api version to 1.34
This commit is contained in:
M. Liebmann
2015-12-22 11:10:56 +01:00
parent beb324c606
commit ee73678d8f
7 changed files with 1078 additions and 90 deletions

View File

@@ -31,14 +31,14 @@ extern "C" {
#include "luainstance_helpers.h"
#define LUA_API_VERSION_MAJOR 1
#define LUA_API_VERSION_MINOR 33
#define LUA_API_VERSION_MINOR 34
void LuaInstRegisterFunctions(lua_State *L, bool fromThreads=false);
/* inspired by Steve Kemp http://www.steve.org.uk/ */
class CLuaInstance
{
static const char className[];
static const luaL_Reg methods[];
static const luaL_Reg menu_methods[];
static CLuaData *CheckData(lua_State *L, int narg);
public:
CLuaInstance();
@@ -58,10 +58,6 @@ public:
// The last parameter to NULL is imperative.
void runScript(const char *fileName, const char *arg0, ...);
private:
lua_State* lua;
void registerFunctions();
static int NewWindow(lua_State *L);
static int GCWindow(lua_State *L);
static int GetInput(lua_State *L);
@@ -80,6 +76,10 @@ private:
static int saveScreen(lua_State *L);
static int restoreScreen(lua_State *L);
static int deleteSavedScreen(lua_State *L);
private:
lua_State* lua;
};
#endif /* _LUAINSTANCE_H */