Commit 9bb32b19 authored by alex@thinkpad's avatar alex@thinkpad
Browse files

lua_task: task name must be allocated by caller (it's not copied, so we must...

lua_task: task name must be allocated by caller (it's not copied, so we must not modify it afterwards)

Easiest way: use the same name for all tasks started by Lua scripts.

--HG--
branch : lua_fix
parent d8f2726ae69d
......@@ -117,10 +117,7 @@ static int luaCB_task_create(lua_State * L)
func->L = L;
func->function_ref = luaL_ref(L, LUA_REGISTRYINDEX);
func->disable_psave = disable_psave;
char task_name[32];
static int lua_task_id = 0;
snprintf(task_name,32,"lua_run_task[%d]",lua_task_id++);
uint32_t ret = (uint32_t) task_create(task_name, priority, stack_size, lua_run_task, func);
uint32_t ret = (uint32_t) task_create("lua_script_task", priority, stack_size, lua_run_task, func);
if (ret & 1) return luaL_error(L, "task not started\n");
return 0;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment