]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: hlua_fcn/queue: fix broken pop_wait()
authorAurelien DARRAGON <adarragon@haproxy.com>
Wed, 10 May 2023 17:30:26 +0000 (19:30 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 11 May 2023 07:23:14 +0000 (09:23 +0200)
commitbd8a94a7594c746b717fde686ea4e3fbdf41f4e9
tree9638c2140e4f95239423a195f18c730af4fe633f
parent0fda8d2c8e0b4b84d474af79003537eef37d11ba
BUG/MINOR: hlua_fcn/queue: fix broken pop_wait()

queue:pop_wait() was broken during late refactor prior to merge.
(Due to small modifications to ensure that pop() returns nil on empty
queue instead of nothing)

Because of this, pop_wait() currently behaves exactly as pop(), resulting
in 100% active CPU when used in a while loop.

Indeed, _hlua_queue_pop() should explicitly return 0 when the queue is
empty since pop_wait logic relies on this and the pushnil should be
handled directly in queue:pop() function instead.

Adding some comments as well to document this.
src/hlua_fcn.c