]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: add hlua_yield_asap() helper
authorAurelien DARRAGON <adarragon@haproxy.com>
Wed, 30 Apr 2025 14:37:56 +0000 (16:37 +0200)
committerAurelien DARRAGON <adarragon@haproxy.com>
Wed, 30 Apr 2025 15:00:27 +0000 (17:00 +0200)
commit97363015a54e46e3efb1f71eb41c0672b9d5c11b
tree50878af131525506a6cef6eac29fe182eb05b7d1
parentdf50d3e39f03828198938cc618fad839d35fb908
MINOR: add hlua_yield_asap() helper

When called, this function will try to enforce a yield (if available) as
soon as possible. Indeed, automatic yield is already enforced every X
Lua instructions. However, there may be some cases where we know after
running heavy operation that we should yield already to avoid taking too
much CPU at once.

This is what this function offers, instead of asking the user to manually
yield using "core.yield()" from Lua itself after using an expensive
Lua method offered by haproxy, we can directly enforce the yield without
the need to do it in the Lua script.
include/haproxy/hlua.h
src/hlua.c