]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: list: make the delete and pop operations idempotent
authorWilly Tarreau <w@1wt.eu>
Thu, 28 Feb 2019 14:05:53 +0000 (15:05 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 28 Feb 2019 15:03:29 +0000 (16:03 +0100)
commit4c747e86cda5d7eab46390779447f216ce9aa5de
treed903da834a8290c4999b058f2445a4507737b4a1
parent690d2ad4d207da5c8821b84ab467090bd515eedf
MINOR: list: make the delete and pop operations idempotent

These operations previously used to return a "locked" element, which is
a constraint when multiple threads try to delete the same element, because
the second one will block indefinitely. Instead, let's make sure that both
LIST_DEL_LOCKED() and LIST_POP_LOCKED() always reinitialize the element
after deleting it. This ensures that the second thread will immediately
unblock and succeed with the removal. It also secures the pop vs delete
competition that may happen when trying to remove an element that's about
to be dequeued.
include/common/mini-clist.h