ptrs_list: make list_foreach self removal safe 21/287921/2
authorMichal Bloch <m.bloch@samsung.com>
Tue, 7 Feb 2023 15:50:33 +0000 (16:50 +0100)
committerMichal Bloch <m.bloch@samsung.com>
Thu, 9 Feb 2023 11:31:25 +0000 (12:31 +0100)
commita08a0aa65979d3128d2c9034e83ddfb01117d4a1
treed908d3bb0cb1bb383de7c3c2e2480d11d99ca6ac
parent7a3e36877ab74eb50e9e444a113a7c043efbb1a8
ptrs_list: make list_foreach self removal safe

The function applied in list_foreach is now allowed to remove
the element on which it is being applied. This will allow us
to simplify various patterns such as "conditional removal that
always returns true" in the daemon.

Change-Id: Ia6e908a3085ad3aecbc6b5eacdcd077fdedaa8e6
Makefile.am
src/shared/ptrs_list.c
src/tests/test_ptrs_list_foreach_pos.c [new file with mode: 0644]