resource-manager: Add guard clause when removing element during list iteration 58/301658/1
authorYoungjae Cho <y0.cho@samsung.com>
Wed, 11 Oct 2023 07:15:01 +0000 (16:15 +0900)
committerYoungjae Cho <y0.cho@samsung.com>
Tue, 21 Nov 2023 07:47:01 +0000 (16:47 +0900)
commit3d60f19b3fa4804793870fa22eb9ba6cd8a00ba6
tree3febd07e0522308cc7f2a4ff8a620318c443567f
parent69bdd0e59e3effe630388e3bf0e5af2fc67c83fe
resource-manager: Add guard clause when removing element during list iteration

When notify callback is underway, removing element from notify list
might mess up the list iteration. Therefore, make it not to remove
list element during iteration. Instead, just mark it as removed and
postpone removal until the entire iteration is completed.

Change-Id: Iea6600be99f8499729d3268a9bd57c70ec7a714d
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
src/resource-manager/resource-manager.c
tests/resource-manager/test.c