Skip to content

Commit

Permalink
Updated example in README.md with new API
Browse files Browse the repository at this point in the history
  • Loading branch information
Elzair committed Nov 20, 2022
1 parent 77c8a79 commit 79765a1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "core_affinity"
version = "0.7.0"
version = "0.7.1"
authors = ["Philip Woods <elzairthesorcerer@gmail.com>"]
description = "Manages CPU affinities"
readme = "README.md"
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ let core_ids = core_affinity::get_core_ids().unwrap();
let handles = core_ids.into_iter().map(|id| {
thread::spawn(move || {
// Pin this thread to a single CPU core.
core_affinity::set_for_current(id);
// Do more work after this.
let res = core_affinity::set_for_current(id);
if (res) {
// Do more work after this.
}
})
}).collect::<Vec<_>>();

Expand Down

0 comments on commit 79765a1

Please sign in to comment.