Skip to content

Commit dc54aec

Browse files
authored
metrics: use mocked AtomicU64 in IO metrics driver (#4649)
1 parent fa665b9 commit dc54aec

File tree

4 files changed

+22
-2
lines changed

4 files changed

+22
-2
lines changed

.github/workflows/ci.yml

+9-1
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ jobs:
228228
- powerpc64-unknown-linux-gnu
229229
- mips-unknown-linux-gnu
230230
- arm-linux-androideabi
231+
- mipsel-unknown-linux-musl
231232
steps:
232233
- uses: actions/checkout@v2
233234
- name: Install Rust ${{ env.rust_stable }}
@@ -241,7 +242,14 @@ jobs:
241242
with:
242243
use-cross: true
243244
command: check
244-
args: --workspace --target ${{ matrix.target }}
245+
args: --workspace --all-features --target ${{ matrix.target }}
246+
- uses: actions-rs/cargo@v1
247+
with:
248+
use-cross: true
249+
command: check
250+
args: --workspace --all-features --target ${{ matrix.target }}
251+
env:
252+
RUSTFLAGS: --cfg tokio_unstable -Dwarnings
245253

246254
features:
247255
name: features

Cross.toml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[build.env]
2+
passthrough = [
3+
"RUSTFLAGS",
4+
]

tokio/src/loom/std/atomic_u64.rs

+8
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,12 @@ cfg_not_has_atomic_u64! {
7575
self.compare_exchange(current, new, success, failure)
7676
}
7777
}
78+
79+
impl Default for AtomicU64 {
80+
fn default() -> AtomicU64 {
81+
Self {
82+
inner: Mutex::new(0),
83+
}
84+
}
85+
}
7886
}

tokio/src/runtime/metrics/io.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#![cfg_attr(not(feature = "net"), allow(dead_code))]
22

3-
use std::sync::atomic::{AtomicU64, Ordering::Relaxed};
3+
use crate::loom::sync::atomic::{AtomicU64, Ordering::Relaxed};
44

55
#[derive(Default)]
66
pub(crate) struct IoDriverMetrics {

0 commit comments

Comments
 (0)