]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: mt_lists: Add new macroes.
authorOlivier Houchard <ohouchard@haproxy.com>
Mon, 12 Aug 2019 12:10:12 +0000 (14:10 +0200)
committerOlivier Houchard <cognet@ci0.org>
Mon, 23 Sep 2019 16:16:08 +0000 (18:16 +0200)
commit5e9b92cbff7d877ea07b3b52461ae603a8ffd622
tree4b0611052a147b1fdf0c4d050445f9576bb2e03d
parent859dc80f947538f7f62bf7314f794d24f6a48e06
MINOR: mt_lists: Add new macroes.

Add a few new macroes to the mt_lists.
MT_LIST_LOCK_ELT()/MT_LIST_UNLOCK_ELT() helps locking/unlocking an element.
This should only be used if you know for sure nobody else will remove the
element from the list in the meanwhile.
mt_list_for_each_entry_safe() is an iterator, similar to
list_for_each_entry_safe().
It takes 5 arguments, item, list_head, member are similar to those of
the non-mt variant, tmpelt is a temporary pointer to a struct mt_list, while
tmpelt2 is a struct mt_list itself.
MT_LIST_DEL_SELF() can be used to delete an item while parsing the list with
mt_list_for_each_entry_safe(). It shouldn't be used outside, and you
shouldn't use MT_LIST_DEL() while using mt_list_for_each_entry_safe().
include/common/mini-clist.h