MINOR: lua-thread: make hlua_ctx_init() get L from its caller
authorThierry Fournier <thierry.fournier@ozon.io>
Sat, 28 Nov 2020 12:18:56 +0000 (13:18 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 2 Dec 2020 20:53:16 +0000 (21:53 +0100)
commit75fc02956b1f2b31d80dda0c9be67c591fa7bade
tree82dc0e0aa84c2417bd75640f85d7854a64282588
parent1eac28f5fc3b5ed293824d5bea04fd9b2723ac37
MINOR: lua-thread: make hlua_ctx_init() get L from its caller

The goal is to allow execution of one main lua state per thread.

The function hlua_ctx_init() now gets the original lua state from
its caller. This allows the initialisation of lua_thread (coroutines)
from any master lua state.

The parent lua state is stored in the hlua struct.

This patch is a temporary transition, it will be modified later.
include/haproxy/hlua-t.h
src/hlua.c