metrics: use mocked AtomicU64 in IO metrics driver (#4649)

This commit is contained in:
Alice Ryhl
2022-05-02 13:32:59 +02:00
committed by GitHub
parent fa665b91a8
commit dc54aec1c7
4 changed files with 22 additions and 2 deletions
+9 -1
View File
@@ -228,6 +228,7 @@ jobs:
- powerpc64-unknown-linux-gnu
- mips-unknown-linux-gnu
- arm-linux-androideabi
- mipsel-unknown-linux-musl
steps:
- uses: actions/checkout@v2
- name: Install Rust ${{ env.rust_stable }}
@@ -241,7 +242,14 @@ jobs:
with:
use-cross: true
command: check
args: --workspace --target ${{ matrix.target }}
args: --workspace --all-features --target ${{ matrix.target }}
- uses: actions-rs/cargo@v1
with:
use-cross: true
command: check
args: --workspace --all-features --target ${{ matrix.target }}
env:
RUSTFLAGS: --cfg tokio_unstable -Dwarnings
features:
name: features
+4
View File
@@ -0,0 +1,4 @@
[build.env]
passthrough = [
"RUSTFLAGS",
]
+8
View File
@@ -75,4 +75,12 @@ cfg_not_has_atomic_u64! {
self.compare_exchange(current, new, success, failure)
}
}
impl Default for AtomicU64 {
fn default() -> AtomicU64 {
Self {
inner: Mutex::new(0),
}
}
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
#![cfg_attr(not(feature = "net"), allow(dead_code))]
use std::sync::atomic::{AtomicU64, Ordering::Relaxed};
use crate::loom::sync::atomic::{AtomicU64, Ordering::Relaxed};
#[derive(Default)]
pub(crate) struct IoDriverMetrics {