]> git.proxmox.com Git - mirror_qemu.git/commit
qht: add qht_iter_remove
authorEmilio G. Cota <cota@braap.org>
Wed, 15 Aug 2018 19:00:48 +0000 (15:00 -0400)
committerRichard Henderson <richard.henderson@linaro.org>
Wed, 26 Sep 2018 15:55:54 +0000 (08:55 -0700)
commit69d55e9cc28dc2f1e2f2426d2a43f2d10db76f29
tree2e997d31cc122f7dcb59d2985ae299251a5590a5
parente2f07efadd15c045bca42661c07b0557c8250e24
qht: add qht_iter_remove

This currently has no users, but the use case is so common that I
think we must support it.

Note that without the appended we cannot safely remove a set of
elements; a 2-step approach (i.e. qht_iter first, keep track of
the to-be-deleted elements, and then a bunch of qht_remove calls)
would be racy, since between the iteration and the removals other
threads might insert additional elements.

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Emilio G. Cota <cota@braap.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
include/qemu/qht.h
util/qht.c