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>
Thu, 12 Aug 2021 06:57:07 +0000 (08:57 +0200)
commit1f43a3430e8b3ae017a12225ac7e523b0d42ffa3
tree61bebcc0a216c48c2ad8d4be1ce766664d16fcc4
parent6fcd2d32805d949672babae8ca70806f8b308870
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.
include/haproxy/hlua-t.h
include/haproxy/hlua.h
src/hlua.c