Repository navigation
fix: synchronize video stats shared with UI threads - #439
Merged
Merged
Conversation
Local-Gate: v1 tree=bd62d3376d49eeb5a69d8c4e9ce1450c48fdeaf6 secs=112 lanes=lint:run,rust-test:run,tier2-linux:run
Ci-Attestation: {"at":1791861355,"gate":"rust/all/fmt","host":"linux-x86_64","key":"d5fffa016b8c3a1269ccc5e000f173d96380f56a319cef69a6e070c346554d73","lane":"lint","parents":["bc52867d5e24d82e2afd900867d5ebd4ba46dfba"],"secs":16,"stamp":"7f29b3b0f387776c4b54315bca8b9a9b","tree":"bd62d3376d49eeb5a69d8c4e9ce1450c48fdeaf6","v":1,"via":"run"}
Ci-Attestation: {"at":1791861355,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"d5fffa016b8c3a1269ccc5e000f173d96380f56a319cef69a6e070c346554d73","lane":"lint","parents":["bc52867d5e24d82e2afd900867d5ebd4ba46dfba"],"secs":16,"stamp":"b38a37aaebe672d723d59ad794b9eefd","tree":"bd62d3376d49eeb5a69d8c4e9ce1450c48fdeaf6","v":1,"via":"run"}
Ci-Attestation: {"at":1791861355,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"d828136e85bb94e10ae94aa79ebb3a6e4789e7c8c021f424dfc75b45b8d14859","lane":"rust-test","parents":["bc52867d5e24d82e2afd900867d5ebd4ba46dfba"],"secs":41,"stamp":"db64e765580e2c850c8aeed0d656a0c7","tree":"bd62d3376d49eeb5a69d8c4e9ce1450c48fdeaf6","v":1,"via":"run"}
Ci-Attestation: {"at":1791861355,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"b94376261666d093499fac534192bbb7d5c7be074ca942c28e6fd04f2ce18e00","lane":"tier2-linux","parents":["bc52867d5e24d82e2afd900867d5ebd4ba46dfba"],"secs":54,"stamp":"9b0cc81c6a4865d7dea26b29b8248df7","tree":"bd62d3376d49eeb5a69d8c4e9ce1450c48fdeaf6","v":1,"via":"run"}
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 #175.
The graphics thread now publishes total/lagged frames and FPS/frame time through a private mutex-backed stats object. The four public getters use the same object. Output start and stop logging reads both frame counts in one snapshot, so those consumers also avoid the race. The C API and exported symbol set are unchanged.
RED commit:
bc52867d5introduced a concurrent reader/writer test against the unlocked helper.cc -std=c11 -O1 -g -fsanitize=thread -fno-omit-frame-pointer test/cmocka/test_video_stats_race.c -lpthreadreported three data races and exited 66.GREEN commit:
769e32465added locking and connected the production fields and consumers. The same ThreadSanitizer test exits 0. The test is registered in the C suite and its checks remain active withNDEBUG.Validation:
./lint,./unittest(142 C tests with Rust OFF and ON), and the stamped local gate passed. OFF and ON exported the same 1766 symbols. Head:dd3bed040e43.