Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/loom.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,21 @@ jobs:
working-directory: tokio
env:
SCOPE: ${{ matrix.scope }}

loom-cancellation-token:
name: loom-cancellation-token
if: github.repository_owner == 'tokio-rs' && (contains(github.event.pull_request.labels.*.name, 'R-loom-sync-util') || (github.base_ref == null))
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Install Rust ${{ env.rust_stable }}
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.rust_stable }}
- uses: Swatinem/rust-cache@v2
- name: Run CancellationToken Loom tests
run: |
LOOM_MAX_PREEMPTIONS=1 LOOM_MAX_BRANCHES=10000 \
RUSTFLAGS="-C debug_assertions --cfg tokio_unstable --cfg loom" \
cargo test --features full --test sync_cancellation_token -- --test-threads=1 --nocapture
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
cargo test --features full --test sync_cancellation_token -- --test-threads=1 --nocapture
cargo test --lib --release --features full -- --test-threads=1 --nocapture loom_cancellation_token

working-directory: tokio
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
working-directory: tokio
working-directory: tokio-util

12 changes: 8 additions & 4 deletions tokio-stream/src/wrappers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ cfg_sync! {
}

cfg_signal! {
#[cfg(unix)]
#[cfg(all(unix, not(loom)))]
mod signal_unix;
#[cfg(unix)]
#[cfg(all(unix, not(loom)))]
pub use signal_unix::SignalStream;

#[cfg(any(windows, docsrs))]
Expand All @@ -39,12 +39,14 @@ cfg_time! {
}

cfg_net! {
#[cfg(not(loom))]
mod tcp_listener;
#[cfg(not(loom))]
pub use tcp_listener::TcpListenerStream;

#[cfg(unix)]
#[cfg(all(unix, not(loom)))]
mod unix_listener;
#[cfg(unix)]
#[cfg(all(unix, not(loom)))]
pub use unix_listener::UnixListenerStream;
}

Expand All @@ -57,6 +59,8 @@ cfg_io_util! {
}

cfg_fs! {
#[cfg(not(loom))]
mod read_dir;
#[cfg(not(loom))]
pub use read_dir::ReadDirStream;
}
1 change: 1 addition & 0 deletions tokio-stream/src/wrappers/read_dir.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![cfg(not(loom))]
use crate::Stream;
use std::io;
use std::pin::Pin;
Expand Down
1 change: 1 addition & 0 deletions tokio-stream/src/wrappers/signal_unix.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![cfg(not(loom))]
use crate::Stream;
use std::pin::Pin;
use std::task::{Context, Poll};
Expand Down
1 change: 1 addition & 0 deletions tokio-stream/src/wrappers/tcp_listener.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![cfg(not(loom))]
use crate::Stream;
use std::io;
use std::pin::Pin;
Expand Down
1 change: 1 addition & 0 deletions tokio-stream/src/wrappers/unix_listener.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![cfg(not(loom))]
use crate::Stream;
use std::io;
use std::pin::Pin;
Expand Down
2 changes: 1 addition & 1 deletion tokio-util/src/net/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//! TCP/UDP/Unix helpers for tokio.

#![cfg(not(loom))]
use crate::either::Either;
use std::future::Future;
use std::io::Result;
Expand Down
2 changes: 1 addition & 1 deletion tokio-util/src/net/unix/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//! Unix domain socket helpers.

#![cfg(not(loom))]
use super::Listener;
use std::io::Result;
use std::task::{Context, Poll};
Expand Down
2 changes: 1 addition & 1 deletion tokio-util/src/udp/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! UDP framing

#![cfg(not(loom))]
mod frame;
pub use frame::UdpFramed;