Skip to content

Commit 67f21fa

Browse files
committed
Revert "Use std::thread::available_parallelism (#6)"
This reverts commit 8daf6fc.
1 parent 6af6022 commit 67f21fa

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

.github/workflows/build-and-test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
fail-fast: false
1212
matrix:
1313
os: [ubuntu-latest, windows-latest, macos-latest]
14-
rust: [nightly, beta, stable, 1.59.0]
14+
rust: [nightly, beta, stable, 1.49.0]
1515
steps:
1616
- uses: actions/checkout@v2
1717

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ documentation = "https://docs.rs/async-global-executor"
1111
keywords = ["async", "await", "future", "executor"]
1212
categories = ["asynchronous", "concurrency"]
1313
readme = "README.md"
14-
rust-version = "1.59"
1514

1615
[features]
1716
default = ["async-io"]
@@ -25,6 +24,7 @@ async-executor = "^1.4"
2524
async-lock = "^2.5"
2625
blocking = "^1.0"
2726
futures-lite = "^1.0"
27+
num_cpus = "^1.13"
2828
once_cell = "^1.4"
2929

3030
[dependencies.async-io]

src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ impl GlobalExecutorConfig {
6464
.ok()
6565
.and_then(|threads| threads.parse().ok())
6666
.or(self.min_threads)
67-
.unwrap_or_else(|| std::thread::available_parallelism().map_or(1, usize::from))
67+
.unwrap_or_else(num_cpus::get)
6868
.max(1);
6969
let max_threads = self.max_threads.unwrap_or(min_threads * 4).max(min_threads);
7070
Config {

0 commit comments

Comments
 (0)