Make num_cpus available to product and vendor am: fd7e77a0a9

Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/num_cpus/+/2476309

Change-Id: I95145677d1db25a4a3cd6083c6e0258d9f32e572
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
tree: 0d1aa95d495c81daeb48b4ec1176178fa081db2d
  1. .github/
  2. ci/
  3. examples/
  4. fixtures/
  5. patches/
  6. src/
  7. .cargo_vcs_info.json
  8. .gitignore
  9. Android.bp
  10. Cargo.toml
  11. Cargo.toml.orig
  12. cargo2android.json
  13. CHANGELOG.md
  14. CONTRIBUTING.md
  15. LICENSE-APACHE
  16. LICENSE-MIT
  17. METADATA
  18. MODULE_LICENSE_APACHE2
  19. OWNERS
  20. README.md
  21. TEST_MAPPING
README.md

num_cpus

crates.io Travis CI Status AppVeyor status

Count the number of CPUs on the current machine.

Usage

Add to Cargo.toml:

[dependencies]
num_cpus = "1.0"

In your main.rs or lib.rs:

extern crate num_cpus;

// count logical cores this process could try to use
let num = num_cpus::get();