Repository navigation
fix(source): read the show/activate ref counts atomically - #2083
Merged
Merged
Conversation
zackees
enabled auto-merge
October 24, 2026 07:24
Member
Author
Member
Author
|
GREEN: TSan run 40074021014 on this branch has 0 data-race summaries in obs_source_active/obs_source_showing (master run 40066620813: 49). Race sides in obs_source_video_tick dropped from 88 to 1. |
chriscoveries
pushed a commit
to chriscoveries/obsrust-fork
that referenced
this pull request
Oct 24, 2026
…#2106) obs_source_remove sets source->removed on the UI thread while the render threads read it (obs_source_removed, obs_view_source_removed, scene add). Make it volatile and use os_atomic_load_bool/os_atomic_set_bool, as obs-rust#2083 did for activate_refs and show_refs. Fixes obs-rust#2105
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2081
activate_refsandshow_refsare changed withos_atomic_inc_long/decfrom the UI and graphics threads, but they were read as plain fields: inobs_source_active/obs_source_showing(called on the audio thread inaudio_callback), in the video tick (now_showing/now_active), and in the add/remove-active-child loops. All six reads now useos_atomic_load_long. The loops take one snapshot of both counts, so they iterate over consistent values.RED: TSan run 40066620813 on master has about 150 data-race reports at obs-source.c.h:4834, 1409 and 1432 against threading-posix.h:21/26, in 16+ tests. A data race fails deterministically only under TSan, so there is no Tier 2 RED; GREEN is a TSan run on this branch, linked below. Behavior is unchanged, and Tier 2 in PR CI covers that.
./lintpasses. Tiers 1 and 3 don't apply: obs-source has no Rust port.