-
Notifications
You must be signed in to change notification settings - Fork 653
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
Add a sched_getcpu
wrapper
#1825
Conversation
src/sched.rs
Outdated
@@ -140,6 +140,13 @@ mod sched_linux_like { | |||
|
|||
Errno::result(res).map(drop) | |||
} | |||
|
|||
/// Determines the CPU on which the calling thread is running. | |||
pub fn sched_getcpu() -> Result<usize> { |
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.
Thanks! Can you modify the existing test here to validate that setting the affinity actually has an effect by calling |
Thanks for the review! I've addressed the comments. |
@jonas-schievink can you squash the current changes into a single commit? Otherwise this looks great. |
Okay, I've squashed the commits |
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.
bors r+
No description provided.