MINOR: lua-thread: Use NULL context for main lua state
authorThierry Fournier <thierry.fournier@ozon.io>
Sat, 28 Nov 2020 12:18:23 +0000 (13:18 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 2 Dec 2020 20:53:16 +0000 (21:53 +0100)
commit4234dbd03bd64ccec888ce1ecf6ccd611ea87b6f
tree2b370e4c437e5b442868ad8614ba13ec8f29ed7a
parent9eb3230b7ca3516151f28998020d48ae44d204da
MINOR: lua-thread: Use NULL context for main lua state

The goal is to no longer use "struct hlua" with global main lua_state.

This patch returns NULL value when some code tries go get the hlua struct
associated with a task through hlua_gethlua(). This functions is useful
only during runtime because the struct hlua contains only runtime states.

Some Lua functions allowed to yield are called from init environment.
I'm not sure this is a good practice. Maybe it will be clever to
disallow calling this kind of functions.
doc/lua-api/index.rst
src/hlua.c