MINOR: lua: Add a flag on lua context to know the yield capability at run time
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 4 Aug 2021 15:58:21 +0000 (17:58 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 20 Sep 2021 14:38:44 +0000 (16:38 +0200)
commitefca07cae13ee798509050f8ecc55d3c5e2b187d
tree99d0887120bcf2e2f7b3a75fde45b4d8cae9f39a
parent83c5b44d7395a7b4902d8be6c69844ad1841b0eb
MINOR: lua: Add a flag on lua context to know the yield capability at run time

When a script is executed, a flag is used to allow it to yield. An error is
returned if a lua function yield, explicitly or not. But there is no way to
get this capability in C functions. So there is no way to choose to yield or
not depending on this capability.

To fill this gap, the flag HLUA_NOYIELD is introduced and added on the lua
context if the current script execution is not authorized to yield. Macros
to set, clear and test this flags are also added.

This feature will be usefull to fix some bugs in lua actions execution.

(cherry picked from commit a6e792ff52f895234bb1499e9df5417bf498a8f8)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
include/haproxy/hlua-t.h
include/haproxy/hlua.h
src/hlua.c