Skip to content

Make radix tree set functions reentrant - #170

Merged
m-blaha merged 1 commit into
rpm-software-management:masterfrom
prownd:make-radix-tree-set-functions-reentrant-s01
Oct 26, 2026
Merged

m-blaha merged 1 commit into
rpm-software-management:masterfrom
prownd:make-radix-tree-set-functions-reentrant-s01

Conversation

@prownd

@prownd prownd commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

__comps_rtree_set(), __comps_mrtree_set(), __comps_brtree_set(), __comps_objrtree_set() and __comps_objmrtree_set() kept their iterator and current node in static local variables. The values are not needed between calls, but the shared state makes the functions unsafe to use from several threads at once, even on unrelated trees (e.g. parsing two comps documents in parallel). Use automatic variables instead.

__comps_rtree_set(), __comps_mrtree_set(), __comps_brtree_set(),
__comps_objrtree_set() and __comps_objmrtree_set() kept their iterator
and current node in static local variables. The values are not needed
between calls, but the shared state makes the functions unsafe to use
from several threads at once, even on unrelated trees (e.g. parsing
two comps documents in parallel). Use automatic variables instead.

Signed-off-by: hanjinpeng <hanjinpeng@kylinos.cn>

@m-blaha m-blaha left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@m-blaha
m-blaha merged commit be0158b into rpm-software-management:master Oct 26, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants