resource-manager: Add guard clause when removing element during list iteration 86/299886/3
authorYoungjae Cho <y0.cho@samsung.com>
Wed, 11 Oct 2023 07:15:01 +0000 (16:15 +0900)
committerYoungjae Cho <y0.cho@samsung.com>
Mon, 16 Oct 2023 07:43:37 +0000 (16:43 +0900)
commit85af4429e52b54e31e2132b3bf8c64e36b108a1e
tree3febd07e0522308cc7f2a4ff8a620318c443567f
parent8e7737961a6c8a9bbd6818e6a729b5b1a804a7d2
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