Address Philip's review comments
This commit is contained in:
parent
9977b13bcd
commit
acddf29fb0
|
@ -453,7 +453,6 @@ static int node_compile( lua_State* L )
|
||||||
static task_handle_t do_node_task_handle;
|
static task_handle_t do_node_task_handle;
|
||||||
static void do_node_task (task_param_t task_fn_ref, uint8_t prio)
|
static void do_node_task (task_param_t task_fn_ref, uint8_t prio)
|
||||||
{
|
{
|
||||||
UNUSED(prio);
|
|
||||||
lua_State* L = lua_getstate();
|
lua_State* L = lua_getstate();
|
||||||
lua_rawgeti(L, LUA_REGISTRYINDEX, (int)task_fn_ref);
|
lua_rawgeti(L, LUA_REGISTRYINDEX, (int)task_fn_ref);
|
||||||
luaL_unref(L, LUA_REGISTRYINDEX, (int)task_fn_ref);
|
luaL_unref(L, LUA_REGISTRYINDEX, (int)task_fn_ref);
|
||||||
|
@ -472,7 +471,7 @@ static int node_task_post( lua_State* L )
|
||||||
Ltype = lua_type(L, ++n);
|
Ltype = lua_type(L, ++n);
|
||||||
}
|
}
|
||||||
luaL_argcheck(L, Ltype == LUA_TFUNCTION || Ltype == LUA_TLIGHTFUNCTION, n, "invalid function");
|
luaL_argcheck(L, Ltype == LUA_TFUNCTION || Ltype == LUA_TLIGHTFUNCTION, n, "invalid function");
|
||||||
lua_pushvalue(L, n);
|
lua_pushvalue(L, n);
|
||||||
|
|
||||||
int task_fn_ref = luaL_ref(L, LUA_REGISTRYINDEX);
|
int task_fn_ref = luaL_ref(L, LUA_REGISTRYINDEX);
|
||||||
|
|
||||||
|
|
|
@ -433,7 +433,7 @@ If the priority is omitted then this defaults to `node.task.MEDIUM_PRIORITY`
|
||||||
```lua
|
```lua
|
||||||
for i = node.task.LOW_PRIORITY, node.task.HIGH_PRIORITY do
|
for i = node.task.LOW_PRIORITY, node.task.HIGH_PRIORITY do
|
||||||
node.task.post(i,function(p2)
|
node.task.post(i,function(p2)
|
||||||
print("priority is ..p2)
|
print("priority is "..p2)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in New Issue