From 9f0daad5acafdd35c1577856e01021293d10849c Mon Sep 17 00:00:00 2001 From: Philip Kannegaard Hayes Date: Sat, 17 Aug 2019 21:30:31 -0700 Subject: [PATCH] sync: fix fuzz_oneshot test by using instrumented `loom::sync::Arc` (#1464) Since `tokio_sync::oneshot` makes a `CausalCell::with_mut()` mutable access in the `Inner::drop()`, we must use the instrumented `loom::sync::Arc`. Uncovered by carllerche/loom#42 --- tokio-sync/src/oneshot.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tokio-sync/src/oneshot.rs b/tokio-sync/src/oneshot.rs index 50176b3d8..dbb766d1c 100644 --- a/tokio-sync/src/oneshot.rs +++ b/tokio-sync/src/oneshot.rs @@ -1,6 +1,6 @@ //! A channel for sending a single message between asynchronous tasks. -use crate::loom::{sync::atomic::AtomicUsize, sync::CausalCell}; +use crate::loom::sync::{atomic::AtomicUsize, Arc, CausalCell}; use futures_core::ready; use std::fmt; @@ -8,7 +8,6 @@ use std::future::Future; use std::mem::MaybeUninit; use std::pin::Pin; use std::sync::atomic::Ordering::{self, AcqRel, Acquire}; -use std::sync::Arc; use std::task::Poll::{Pending, Ready}; use std::task::{Context, Poll, Waker};