-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
rt: pop at least one task from inject queue #5908
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -787,6 +787,10 @@ impl Core { | |||||
cap, | ||||||
); | ||||||
|
||||||
// Take at least one task since the first task is returned directly | ||||||
// and nto pushed onto the local queue. | ||||||
let n = usize::max(1, n); | ||||||
|
||||||
let mut synced = worker.handle.shared.synced.lock(); | ||||||
// safety: passing in the correct `inject::Synced`. | ||||||
let mut tasks = unsafe { worker.inject().pop_n(&mut synced.inject, n) }; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In fact, maybe do this and drop the plus one in the first branch of
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But that isn't the same. We don't want to always add |
||||||
|
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.
Seems like you should add one to
cap
in theusize::min
above instead, no?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.
I could... I thought it would be clearer to split it out w/ a comment.