-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Simplify wait in slices logic. NFC. #15739
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 13 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
59aac0a
Simplify/unify wait in slices logic. NFC.
kleisauke c0b7882
Revert unnecessary changes
kleisauke 21c0823
Revert hoisting of `self` changes
kleisauke e9692af
Revert small doc changes
kleisauke 2a52598
Drop const for changed lines
kleisauke 4b8a024
Prefer snake_case for changed lines
kleisauke 961e320
Revert `emscripten_wait_for_call_v` change
kleisauke 4784dfa
Consolidate vars
kleisauke 02ba5d6
s/max_ms_to_sleep/max_ms_slice_to_sleep/g
kleisauke c8d47d0
Avoid call to `emscripten_futex_wait` when `msecsToSleep <= 0`
kleisauke 40064d6
Resolve test failures
kleisauke 70bfc3b
Split ternary operation over 2 lines
kleisauke ecbd5fa
Revert non-NFC change
kleisauke 7d74c53
Incorporate review comment
kleisauke File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The loop condition here seems a little odd to me. It doesn't seem to take into account that time has elapsed during emscripten_futex_wait. Perhaps adding
ms_to_sleep = target - now;
as the very last thing line of the loop would fix it? But then we are kind of re-using the singlems_to_sleep
to mean two different things: How long to sleep for this loop cylcle, and the total remain time to sleep.. Maybe we should keep those things logically separate for readability?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commit 7d74c53 takes the elapsed time during
emscripten_futex_wait
into account.