MEDIUM: lua-thread: Apply lock only if the parent state is the main thread
authorThierry Fournier <thierry.fournier@ozon.io>
Sat, 28 Nov 2020 16:02:21 +0000 (17:02 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 2 Dec 2020 20:53:16 +0000 (21:53 +0100)
commit7cbe5046e879368b54917a0a2171f729d8bb98d4
treeb7cb1ea4c2b0de2e3ecbbf45e9752cef0baf8437
parent3c539327f49f3457d866053d753795d9168dbcb8
MEDIUM: lua-thread: Apply lock only if the parent state is the main thread

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

This patch opens the way to addition of a per-thread dedicated lua state.
By passing the hlua we can figure the original state that's been used
and decide to lock or not.
src/hlua.c