MINOR: lua-thread: Replace global gL var with an array of states
authorThierry Fournier <thierry.fournier@ozon.io>
Sat, 28 Nov 2020 16:06:51 +0000 (17:06 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 2 Dec 2020 20:53:16 +0000 (21:53 +0100)
commitafc63e2cb1ff270d86823ac55fdbb25a46836e04
treeacb44755eb3115875d12c61132fd0c4ab2cd3572
parent7cbe5046e879368b54917a0a2171f729d8bb98d4
MINOR: lua-thread: Replace global gL var with an array of states

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

The array of states is initialized at the max number of thread +1.
We define the index 0 is the common state shared by all threads
and should be locked. Other index index are dedicated to each
one thread. The old gL now becomes hlua_states[0].
src/hlua.c