]> git.ipfire.org Git - thirdparty/qemu.git/commit
util/interval-tree: Use qatomic_read/set for rb_parent_color
authorRichard Henderson <richard.henderson@linaro.org>
Sat, 22 Jul 2023 14:17:38 +0000 (15:17 +0100)
committerRichard Henderson <richard.henderson@linaro.org>
Mon, 31 Jul 2023 19:19:13 +0000 (12:19 -0700)
commit79e29851bf57741252a20838cdc59074ab5bac29
tree3f621495d951e70fda813d2903fa73148d4cede1
parentd37a259fa4f5164e300e8a20cdd83fe39c7fdadb
util/interval-tree: Use qatomic_read/set for rb_parent_color

While less susceptible to optimization problems than left and right,
interval_tree_iter_next also reads rb_parent(), so make sure that
stores and loads are atomic.

This goes further than technically required, changing all loads to
be atomic, rather than simply the ones in the iteration side.  But
it doesn't really affect the code generation on the rebalance side
and is cleaner to handle everything the same.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
util/interval-tree.c