Skip to content

Commit

Permalink
use atomic type in loom instead
Browse files Browse the repository at this point in the history
  • Loading branch information
wathenjiang committed Sep 20, 2023
1 parent 06a675c commit 2be70c4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tokio/src/runtime/task/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ use crate::loom::sync::Mutex;
use crate::runtime::task::{JoinHandle, LocalNotified, Notified, Schedule, Task};
use crate::util::linked_list::{Link, LinkedList};

use crate::loom::sync::atomic::{AtomicBool, Ordering};
use std::marker::PhantomData;
use std::num::NonZeroU32;
use std::sync::atomic::AtomicBool;
use std::sync::atomic::{AtomicU32, Ordering};

// The id from the module below is used to verify whether a given task is stored
// in this OwnedTasks, or some other task. The counter starts at one so we can
Expand All @@ -27,7 +26,7 @@ use std::sync::atomic::{AtomicU32, Ordering};
// bug in Tokio, so we accept that certain bugs would not be caught if the two
// mixed up runtimes happen to have the same id.

static NEXT_OWNED_TASKS_ID: AtomicU32 = AtomicU32::new(1);
static NEXT_OWNED_TASKS_ID: std::sync::atomic::AtomicU32 = std::sync::atomic::AtomicU32::new(1);

fn get_next_id() -> NonZeroU32 {
loop {
Expand Down

0 comments on commit 2be70c4

Please sign in to comment.