Skip to content

Commit 259996d

Browse files
committed
Remove NEXT_LOOP_ID
This is no longer needed now that the public-facing `CoreId` has been removed
1 parent 329bca1 commit 259996d

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

src/reactor/mod.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
use std::fmt;
2424
use std::io::{self, ErrorKind};
2525
use std::sync::{Arc, Weak, RwLock};
26-
use std::sync::atomic::{AtomicUsize, ATOMIC_USIZE_INIT, Ordering};
26+
use std::sync::atomic::{AtomicUsize, Ordering};
2727
use std::time::{Duration};
2828

2929
use futures::{Future, Async};
@@ -38,9 +38,6 @@ mod io_token;
3838
mod poll_evented;
3939
pub use self::poll_evented::PollEvented;
4040

41-
/// Global counter used to assign unique IDs to reactor instances.
42-
static NEXT_LOOP_ID: AtomicUsize = ATOMIC_USIZE_INIT;
43-
4441
/// The core reactor, or event loop.
4542
///
4643
/// The event loop is the main source of blocking in an application which drives
@@ -62,9 +59,6 @@ pub struct Core {
6259
}
6360

6461
struct Inner {
65-
/// Unique identifier referencing this reactor.
66-
id: usize,
67-
6862
/// The underlying system event queue.
6963
io: mio::Poll,
7064

@@ -79,7 +73,6 @@ struct Inner {
7973
/// and will instead use and implicitly configured handle for your thread.
8074
#[derive(Clone)]
8175
pub struct Handle {
82-
id: usize,
8376
inner: Weak<Inner>,
8477
}
8578

@@ -123,7 +116,6 @@ impl Core {
123116
_future_registration: future_pair.0,
124117
future_readiness: Arc::new(MySetReadiness(future_pair.1)),
125118
inner: Arc::new(Inner {
126-
id: NEXT_LOOP_ID.fetch_add(1, Ordering::Relaxed),
127119
io: io,
128120
io_dispatch: RwLock::new(Slab::with_capacity(1)),
129121
}),
@@ -138,7 +130,6 @@ impl Core {
138130
/// to bind them to this event loop.
139131
pub fn handle(&self) -> Handle {
140132
Handle {
141-
id: self.inner.id,
142133
inner: Arc::downgrade(&self.inner),
143134
}
144135
}

0 commit comments

Comments
 (0)