MINOR: lua-thread: Add the "thread" core variable
authorThierry Fournier <thierry.fournier@ozon.io>
Sat, 28 Nov 2020 14:49:44 +0000 (15:49 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 2 Dec 2020 20:53:16 +0000 (21:53 +0100)
commitecb83c24c43d85a6b4de043b426c1248d4d97318
tree52257a42db16118891629bc9405c6c89b8dfc5df
parentb8cef175bd96ed25d7748d9f7d288b8bb5ce27d7
MINOR: lua-thread: Add the "thread" core variable

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

This commit introduces this variable in the core. Lua state initialized
by thread will have access to this variable, which reports the executing
thread. 0 indicates the shared thread. Programs which must be executed
only once can check for core.thread <= 1.
doc/lua-api/index.rst
src/hlua.c