}
/** @brief leaves a new userdata on top of the stack, sets its metatable, and sets the Task pointer inside the userdata */
}
/** @brief leaves a new userdata on top of the stack, sets its metatable, and sets the Task pointer inside the userdata */
DEBUG1("push lua task with Name : %s \n",MSG_task_get_name(*pi));
luaL_getmetatable(L,TASK_MODULE_NAME);
lua_setmetatable(L,-2);
return pi;
DEBUG1("push lua task with Name : %s \n",MSG_task_get_name(*pi));
luaL_getmetatable(L,TASK_MODULE_NAME);
lua_setmetatable(L,-2);
return pi;
m_task_t tk = checkTask(L,-2);
const char *mailbox = luaL_checkstring(L,-1);
lua_pop(L,1); // remove the string so that the task is on top of it
m_task_t tk = checkTask(L,-2);
const char *mailbox = luaL_checkstring(L,-1);
lua_pop(L,1); // remove the string so that the task is on top of it
static int Task_recv(lua_State *L) {
m_task_t tk = NULL;
const char *mailbox = luaL_checkstring(L,-1);
static int Task_recv(lua_State *L) {
m_task_t tk = NULL;
const char *mailbox = luaL_checkstring(L,-1);
}
lua_newtable (L); /* create a table, put the userdata on top of it */
m_host_t *lua_host = (m_host_t*)lua_newuserdata(L,sizeof(m_host_t));
}
lua_newtable (L); /* create a table, put the userdata on top of it */
m_host_t *lua_host = (m_host_t*)lua_newuserdata(L,sizeof(m_host_t));
static int run_lua_code(int argc,char **argv) {
DEBUG1("Run lua code %s",argv[0]);
static int run_lua_code(int argc,char **argv) {
DEBUG1("Run lua code %s",argv[0]);
lua_State *L = lua_newthread(simgrid_lua_state);
int ref = luaL_ref(simgrid_lua_state, LUA_REGISTRYINDEX); // protect the thread from being garbage collected
int res = 1;
lua_State *L = lua_newthread(simgrid_lua_state);
int ref = luaL_ref(simgrid_lua_state, LUA_REGISTRYINDEX); // protect the thread from being garbage collected
int res = 1;