mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Auto merge of #28248 - delosrogers:issue-#28243, r=emilio
Use swap() instead of load()/store() in get_and_reset_text_shaping_performance_counter() <!-- Please describe your changes on the following line: --> Replaced usage of `.load()` then `.store()` with `.swap()` to prevent possible atomicity issues. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #28245 <!-- Either: --> - [ ] There are tests for these changes OR - [X] These changes do not require tests because: They do not change function of the code. <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
This commit is contained in:
commit
eb7588be38
1 changed files with 1 additions and 2 deletions
|
@ -522,8 +522,7 @@ impl RunMetrics {
|
|||
}
|
||||
|
||||
pub fn get_and_reset_text_shaping_performance_counter() -> usize {
|
||||
let value = TEXT_SHAPING_PERFORMANCE_COUNTER.load(Ordering::SeqCst);
|
||||
TEXT_SHAPING_PERFORMANCE_COUNTER.store(0, Ordering::SeqCst);
|
||||
let value = TEXT_SHAPING_PERFORMANCE_COUNTER.swap(0, Ordering::SeqCst);
|
||||
value
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue