Skip to content

Comments

fix race in refcount#426

Merged
themrdemonized merged 1 commit intothemrdemonized:egerfrom
erepb:race1
Feb 13, 2026
Merged

fix race in refcount#426
themrdemonized merged 1 commit intothemrdemonized:egerfrom
erepb:race1

Conversation

@erepb
Copy link
Contributor

@erepb erepb commented Feb 9, 2026

render thread and lua calls (map_add_object_spot for example) can access same refcounters which in case of a race gives crash when counter is decremented more than incremented.

main change is in xr_resource, two other were changed just in case because they use same pattern.

@themrdemonized
Copy link
Owner

For resources, i tested atomic counter in MT version before, it lead to severe performance issues. I chose critical section blocking instead for resources, might port it later.

str_value does use atomic there

@erepb
Copy link
Contributor Author

erepb commented Feb 9, 2026

i see. feel free to close PR then. warfare mode seems to more extensively use affected lua calls and crashes quite regularly. backport is highly appreciated

@themrdemonized themrdemonized changed the base branch from all-in-one-vs2022-wpo to eger February 13, 2026 06:50
@themrdemonized themrdemonized merged commit dda5d04 into themrdemonized:eger Feb 13, 2026
17 of 18 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