id stringlengths 22 133 | text stringlengths 40 40.2k | arch stringclasses 1
value | syntax stringclasses 1
value | kind stringclasses 4
values | repo stringclasses 27
values | path stringlengths 5 116 | license stringclasses 6
values | commit stringlengths 40 40 | source_host stringclasses 1
value | category stringclasses 16
values | source_url stringlengths 85 196 | line_start int64 1 4.28k | line_end int64 4 4.31k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
tokio-rs/tokio:tokio/src/runtime/threadpool/mod.rs:6 | /// Spawn a future onto the Tokio runtime.
///
/// This spawns the given future onto the runtime's executor, usually a
/// thread pool. The thread pool is then responsible for polling the future
/// until it completes.
///
/// See [module level][mod] documentation for more details.
///
/... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/threadpool/mod.rs | MIT | 5c0b56278b95a16f2f0b6dedfffe730b39d52948 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/5c0b56278b95a16f2f0b6dedfffe730b39d52948/tokio/src/runtime/threadpool/mod.rs | 201 | 260 |
tokio-rs/tokio:tokio/src/runtime/threadpool/mod.rs:7 | /// Run a future to completion on the Tokio runtime.
///
/// This runs the given future on the runtime, blocking until it is
/// complete, and yielding its resolved result. Any tasks or timers which
/// the future spawns internally will be executed on the runtime.
///
/// This method should not ... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/threadpool/mod.rs | MIT | 5c0b56278b95a16f2f0b6dedfffe730b39d52948 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/5c0b56278b95a16f2f0b6dedfffe730b39d52948/tokio/src/runtime/threadpool/mod.rs | 241 | 300 |
tokio-rs/tokio:tokio/src/runtime/threadpool/mod.rs:9 | /// // Use the runtime...
///
/// // Shutdown the runtime
/// rt.shutdown_on_idle()
/// .wait().unwrap();
/// ```
///
/// [mod]: index.html
pub fn shutdown_on_idle(mut self) -> Shutdown {
let inner = self.inner.take().unwrap();
let inner = inner.pool.shutdown_on_idle(... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/threadpool/mod.rs | MIT | 5c0b56278b95a16f2f0b6dedfffe730b39d52948 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/5c0b56278b95a16f2f0b6dedfffe730b39d52948/tokio/src/runtime/threadpool/mod.rs | 321 | 380 |
tokio-rs/tokio:tokio/src/runtime/threadpool/mod.rs:10 | ///
/// // Use the runtime...
///
/// // Shutdown the runtime
/// rt.shutdown_now()
/// .wait().unwrap();
/// ```
///
/// [mod]: index.html
pub fn shutdown_now(mut self) -> Shutdown {
let inner = self.inner.take().unwrap();
Shutdown::shutdown_now(inner)
}
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/threadpool/mod.rs | MIT | 5c0b56278b95a16f2f0b6dedfffe730b39d52948 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/5c0b56278b95a16f2f0b6dedfffe730b39d52948/tokio/src/runtime/threadpool/mod.rs | 361 | 391 |
tokio-rs/tokio:tokio/src/runtime/threadpool/mod.rs:6 | /// Spawn a future onto the Tokio runtime.
///
/// This spawns the given future onto the runtime's executor, usually a
/// thread pool. The thread pool is then responsible for polling the future
/// until it completes.
///
/// See [module level][mod] documentation for more details.
///
/... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/threadpool/mod.rs | MIT | cb4aea394e6851ae8cc45a68beeaf2c93cc9a0c0 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/cb4aea394e6851ae8cc45a68beeaf2c93cc9a0c0/tokio/src/runtime/threadpool/mod.rs | 201 | 260 |
tokio-rs/tokio:tokio/src/runtime/threadpool/mod.rs:1 | mod builder;
mod shutdown;
mod task_executor;
#[cfg(feature = "async-await-preview")]
mod async_await;
pub use self::builder::Builder;
pub use self::shutdown::Shutdown;
pub use self::task_executor::TaskExecutor;
use reactor::{Handle, Reactor};
use std::io;
use std::sync::Mutex;
use tokio_executor::enter;
use tokio... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/threadpool/mod.rs | MIT | 0e400af78c049c4b52fa4cb346237b43218b0ec9 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/0e400af78c049c4b52fa4cb346237b43218b0ec9/tokio/src/runtime/threadpool/mod.rs | 1 | 60 |
tokio-rs/tokio:tokio/src/runtime/threadpool/mod.rs:4 | /// will use [`tokio::run`](fn.run.html).
///
/// See [module level][mod] documentation for more details.
///
/// # Examples
///
/// Creating a new `Runtime` with default configuration values.
///
/// ```
/// use tokio::runtime::Runtime;
/// use tokio::prelude::*;
///
///... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/threadpool/mod.rs | MIT | 0e400af78c049c4b52fa4cb346237b43218b0ec9 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/0e400af78c049c4b52fa4cb346237b43218b0ec9/tokio/src/runtime/threadpool/mod.rs | 121 | 180 |
tokio-rs/tokio:tokio/src/runtime/threadpool/mod.rs:5 | /// # Examples
///
/// ```
/// use tokio::runtime::Runtime;
///
/// let rt = Runtime::new()
/// .unwrap();
///
/// let reactor_handle = rt.reactor().clone();
///
/// // use `reactor_handle`
/// ```
#[deprecated(since = "0.1.11", note = "there is now a reactor per work... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/threadpool/mod.rs | MIT | 0e400af78c049c4b52fa4cb346237b43218b0ec9 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/0e400af78c049c4b52fa4cb346237b43218b0ec9/tokio/src/runtime/threadpool/mod.rs | 161 | 220 |
tokio-rs/tokio:tokio/src/runtime/threadpool/mod.rs:7 | pub fn spawn<F>(&mut self, future: F) -> &mut Self
where F: Future<Item = (), Error = ()> + Send + 'static,
{
self.inner_mut().pool.sender().spawn(future).unwrap();
self
}
/// Run a future to completion on the Tokio runtime.
///
/// This runs the given future on the runtime, blo... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/threadpool/mod.rs | MIT | 0e400af78c049c4b52fa4cb346237b43218b0ec9 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/0e400af78c049c4b52fa4cb346237b43218b0ec9/tokio/src/runtime/threadpool/mod.rs | 241 | 300 |
tokio-rs/tokio:tokio/src/runtime/threadpool/mod.rs:8 | ///
/// # Panics
///
/// This function panics if the executor is at capacity, if the provided
/// future panics, or if called within an asynchronous execution context.
pub fn block_on_all<F, R, E>(mut self, future: F) -> Result<R, E>
where
F: Send + 'static + Future<Item = R, Error = E>,... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/threadpool/mod.rs | MIT | 0e400af78c049c4b52fa4cb346237b43218b0ec9 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/0e400af78c049c4b52fa4cb346237b43218b0ec9/tokio/src/runtime/threadpool/mod.rs | 281 | 340 |
tokio-rs/tokio:tokio/src/runtime/threadpool/mod.rs:10 | ///
/// ```
/// use tokio::runtime::Runtime;
/// use tokio::prelude::*;
///
/// let rt = Runtime::new()
/// .unwrap();
///
/// // Use the runtime...
///
/// // Shutdown the runtime
/// rt.shutdown_now()
/// .wait().unwrap();
/// ```
///
/// [mod]: inde... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/threadpool/mod.rs | MIT | 0e400af78c049c4b52fa4cb346237b43218b0ec9 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/0e400af78c049c4b52fa4cb346237b43218b0ec9/tokio/src/runtime/threadpool/mod.rs | 361 | 398 |
tokio-rs/tokio:tokio/src/runtime/threadpool/shutdown.rs:1 | use futures::{try_ready, Future, Poll};
use tokio_threadpool as threadpool;
use std::fmt;
use super::Inner;
/// A future that resolves when the Tokio `Runtime` is shut down.
pub struct Shutdown {
pub(super) inner: threadpool::Shutdown,
}
impl Shutdown {
pub(super) fn shutdown_now(inner: Inner) -> Self {
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/threadpool/shutdown.rs | MIT | cb4aea394e6851ae8cc45a68beeaf2c93cc9a0c0 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/cb4aea394e6851ae8cc45a68beeaf2c93cc9a0c0/tokio/src/runtime/threadpool/shutdown.rs | 1 | 34 |
tokio-rs/tokio:tokio/src/runtime/threadpool/spawner.rs:1 | use crate::executor::thread_pool;
use crate::runtime::JoinHandle;
use std::future::Future;
/// Spawns futures on the runtime
///
/// All futures spawned using this executor will be submitted to the associated
/// Runtime's executor. This executor is usually a thread pool.
///
/// For more details, see the [module lev... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/threadpool/spawner.rs | MIT | c62ef2d232dea1535a8e22484fa2ca083f03e903 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/c62ef2d232dea1535a8e22484fa2ca083f03e903/tokio/src/runtime/threadpool/spawner.rs | 1 | 59 |
tokio-rs/tokio:tokio/src/runtime/threadpool/task_executor.rs:1 | use tokio_executor::SpawnError;
use tokio_executor::threadpool::Sender;
use std::future::Future;
use std::pin::Pin;
/// Executes futures on the runtime
///
/// All futures spawned using this executor will be submitted to the associated
/// Runtime's executor. This executor is usually a thread pool.
///
/// For more d... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/threadpool/task_executor.rs | MIT | d1f60ac4c69792211f9c9f3bcff1559bc0cb837a | github | async-runtime | https://github.com/tokio-rs/tokio/blob/d1f60ac4c69792211f9c9f3bcff1559bc0cb837a/tokio/src/runtime/threadpool/task_executor.rs | 1 | 60 |
tokio-rs/tokio:tokio/src/runtime/threadpool/task_executor.rs:2 | /// println!("now running on a worker thread");
/// });
/// # }
/// ```
///
/// # Panics
///
/// This function panics if the spawn fails. Failure occurs if the executor
/// is currently at capacity and is unable to spawn a new future.
pub fn spawn<F>(&self, future: F)
where F... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/threadpool/task_executor.rs | MIT | d1f60ac4c69792211f9c9f3bcff1559bc0cb837a | github | async-runtime | https://github.com/tokio-rs/tokio/blob/d1f60ac4c69792211f9c9f3bcff1559bc0cb837a/tokio/src/runtime/threadpool/task_executor.rs | 41 | 73 |
tokio-rs/tokio:tokio/src/runtime/threadpool/task_executor.rs:1 | use tokio_executor::SpawnError;
use tokio_executor::threadpool::Sender;
use std::future::Future;
use std::pin::Pin;
/// Executes futures on the runtime
///
/// All futures spawned using this executor will be submitted to the associated
/// Runtime's executor. This executor is usually a thread pool.
///
/// For more d... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/threadpool/task_executor.rs | MIT | a791f4a758604768463d3ca2162b913dcea34c40 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/a791f4a758604768463d3ca2162b913dcea34c40/tokio/src/runtime/threadpool/task_executor.rs | 1 | 60 |
tokio-rs/tokio:tokio/src/runtime/threadpool/task_executor.rs:1 | use tokio_executor::SpawnError;
use tokio_executor::threadpool::Sender;
use std::future::Future;
use std::pin::Pin;
/// Executes futures on the runtime
///
/// All futures spawned using this executor will be submitted to the associated
/// Runtime's executor. This executor is usually a thread pool.
///
/// For more d... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/threadpool/task_executor.rs | MIT | 3b27dc31d28df93fcc65ed3b744033d4ad4f77cc | github | async-runtime | https://github.com/tokio-rs/tokio/blob/3b27dc31d28df93fcc65ed3b744033d4ad4f77cc/tokio/src/runtime/threadpool/task_executor.rs | 1 | 60 |
tokio-rs/tokio:tokio/src/runtime/threadpool/task_executor.rs:2 | /// // Spawn a future onto the runtime
/// executor.spawn(async {
/// println!("now running on a worker thread");
/// });
/// # }
/// ```
///
/// # Panics
///
/// This function panics if the spawn fails. Failure occurs if the executor
/// is currently at capacity and is unabl... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/threadpool/task_executor.rs | MIT | 3b27dc31d28df93fcc65ed3b744033d4ad4f77cc | github | async-runtime | https://github.com/tokio-rs/tokio/blob/3b27dc31d28df93fcc65ed3b744033d4ad4f77cc/tokio/src/runtime/threadpool/task_executor.rs | 41 | 75 |
tokio-rs/tokio:tokio/src/runtime/threadpool/task_executor.rs:1 | use tokio_executor::SpawnError;
use tokio_threadpool::Sender;
use std::future::Future;
use std::pin::Pin;
/// Executes futures on the runtime
///
/// All futures spawned using this executor will be submitted to the associated
/// Runtime's executor. This executor is usually a thread pool.
///
/// For more details, se... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/threadpool/task_executor.rs | MIT | 47e2ff48d9f1daac7dba9f136b24eed64c87cf40 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/47e2ff48d9f1daac7dba9f136b24eed64c87cf40/tokio/src/runtime/threadpool/task_executor.rs | 1 | 60 |
tokio-rs/tokio:tokio/src/runtime/threadpool/task_executor.rs:1 | use tokio_executor::SpawnError;
use tokio_threadpool::Sender;
use std::future::Future;
use std::pin::Pin;
/// Executes futures on the runtime
///
/// All futures spawned using this executor will be submitted to the associated
/// Runtime's executor. This executor is usually a thread pool.
///
/// For more details, se... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/threadpool/task_executor.rs | MIT | bd3f3270dbf632a7e23e82dd93605db1fe050ee9 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/bd3f3270dbf632a7e23e82dd93605db1fe050ee9/tokio/src/runtime/threadpool/task_executor.rs | 1 | 60 |
tokio-rs/tokio:tokio/src/runtime/threadpool/task_executor.rs:2 | /// executor.spawn(future::lazy(|| {
/// println!("now running on a worker thread");
/// Ok(())
/// }));
/// # }
/// # pub fn main() {}
/// ```
///
/// # Panics
///
/// This function panics if the spawn fails. Failure occurs if the executor
/// is currently at capacit... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/threadpool/task_executor.rs | MIT | bd3f3270dbf632a7e23e82dd93605db1fe050ee9 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/bd3f3270dbf632a7e23e82dd93605db1fe050ee9/tokio/src/runtime/threadpool/task_executor.rs | 41 | 76 |
tokio-rs/tokio:tokio/src/runtime/threadpool/task_executor.rs:1 | use futures::future::{self, Future};
use tokio_threadpool::Sender;
/// Executes futures on the runtime
///
/// All futures spawned using this executor will be submitted to the associated
/// Runtime's executor. This executor is usually a thread pool.
///
/// For more details, see the [module level](index.html) documen... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/threadpool/task_executor.rs | MIT | cb4aea394e6851ae8cc45a68beeaf2c93cc9a0c0 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/cb4aea394e6851ae8cc45a68beeaf2c93cc9a0c0/tokio/src/runtime/threadpool/task_executor.rs | 1 | 60 |
tokio-rs/tokio:tokio/src/runtime/threadpool/task_executor.rs:2 | /// }));
/// # }
/// # pub fn main() {}
/// ```
///
/// # Panics
///
/// This function panics if the spawn fails. Failure occurs if the executor
/// is currently at capacity and is unable to spawn a new future.
pub fn spawn<F>(&self, future: F)
where F: Future<Item = (), Error = ... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/threadpool/task_executor.rs | MIT | cb4aea394e6851ae8cc45a68beeaf2c93cc9a0c0 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/cb4aea394e6851ae8cc45a68beeaf2c93cc9a0c0/tokio/src/runtime/threadpool/task_executor.rs | 41 | 80 |
tokio-rs/tokio:tokio/src/runtime/threadpool/task_executor.rs:1 | use tokio_threadpool::Sender;
use futures::future::{self, Future};
/// Executes futures on the runtime
///
/// All futures spawned using this executor will be submitted to the associated
/// Runtime's executor. This executor is usually a thread pool.
///
/// For more details, see the [module level](index.html) docume... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/threadpool/task_executor.rs | MIT | b1172f8074b381b543ff15e23e3092fc5dc6de7d | github | async-runtime | https://github.com/tokio-rs/tokio/blob/b1172f8074b381b543ff15e23e3092fc5dc6de7d/tokio/src/runtime/threadpool/task_executor.rs | 1 | 60 |
tokio-rs/tokio:tokio/src/runtime/threadpool/task_executor.rs:2 | /// executor.spawn(future::lazy(|| {
/// println!("now running on a worker thread");
/// Ok(())
/// }));
/// # }
/// # pub fn main() {}
/// ```
///
/// # Panics
///
/// This function panics if the spawn fails. Failure occurs if the executor
/// is currently at capacit... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/threadpool/task_executor.rs | MIT | b1172f8074b381b543ff15e23e3092fc5dc6de7d | github | async-runtime | https://github.com/tokio-rs/tokio/blob/b1172f8074b381b543ff15e23e3092fc5dc6de7d/tokio/src/runtime/threadpool/task_executor.rs | 41 | 83 |
tokio-rs/tokio:tokio/src/runtime/time.rs:1 | //! Abstracts out the APIs necessary to `Runtime` for integrating the time
//! driver. When the `time` feature flag is **not** enabled. These APIs are
//! shells. This isolates the complexity of dealing with conditional
//! compilation.
pub(crate) use variant::*;
#[cfg(feature = "time")]
mod variant {
use crate::... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time.rs | MIT | 45da5f3510a61599c89dc458ecc859f13a81e255 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/45da5f3510a61599c89dc458ecc859f13a81e255/tokio/src/runtime/time.rs | 1 | 59 |
tokio-rs/tokio:tokio/src/runtime/time.rs:1 | //! Abstracts out the APIs necessary to `Runtime` for integrating the time
//! driver. When the `time` feature flag is **not** enabled. These APIs are
//! shells. This isolates the complexity of dealing with conditional
//! compilation.
pub(crate) use variant::*;
#[cfg(all(feature = "time", not(loom)))]
mod variant {... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time.rs | MIT | 67bf9c36f347031ca05872d102a7f9abc8b465f0 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/67bf9c36f347031ca05872d102a7f9abc8b465f0/tokio/src/runtime/time.rs | 1 | 59 |
tokio-rs/tokio:tokio/src/runtime/time.rs:1 | //! Abstracts out the APIs necessary to `Runtime` for integrating the time
//! driver. When the `time` feature flag is **not** enabled. These APIs are
//! shells. This isolates the complexity of dealing with conditional
//! compilation.
pub(crate) use variant::*;
#[cfg(all(feature = "time", not(loom)))]
mod variant {... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time.rs | MIT | 8546ff826db8dba1e39b4119ad909fb6cab2492a | github | async-runtime | https://github.com/tokio-rs/tokio/blob/8546ff826db8dba1e39b4119ad909fb6cab2492a/tokio/src/runtime/time.rs | 1 | 60 |
tokio-rs/tokio:tokio/src/runtime/time.rs:2 | {
let _time = handle.as_ref().map(|handle| driver::set_default(handle));
clock.enter(f)
}
}
#[cfg(any(not(feature = "time"), loom))]
mod variant {
use crate::runtime::io;
pub(crate) type Clock = ();
pub(crate) type Driver = io::Driver;
pub(crate) type Handle = ();
pub(crate) f... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time.rs | MIT | 8546ff826db8dba1e39b4119ad909fb6cab2492a | github | async-runtime | https://github.com/tokio-rs/tokio/blob/8546ff826db8dba1e39b4119ad909fb6cab2492a/tokio/src/runtime/time.rs | 41 | 74 |
tokio-rs/tokio:tokio/src/runtime/time.rs:1 | //! Abstracts out the APIs necessary to `Runtime` for integrating the time
//! driver. When the `time` feature flag is **not** enabled. These APIs are
//! shells. This isolates the complexity of dealing with conditional
//! compilation.
cfg_time! {
use crate::runtime::io;
use crate::time::{self, driver};
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time.rs | MIT | 0d38936b35779b604770120da2e98560bbb6241f | github | async-runtime | https://github.com/tokio-rs/tokio/blob/0d38936b35779b604770120da2e98560bbb6241f/tokio/src/runtime/time.rs | 1 | 57 |
tokio-rs/tokio:tokio/src/runtime/time.rs:1 | //! Abstracts out the APIs necessary to `Runtime` for integrating the time
//! driver. When the `time` feature flag is **not** enabled. These APIs are
//! shells. This isolates the complexity of dealing with conditional
//! compilation.
pub(crate) use self::variant::*;
#[cfg(feature = "time")]
mod variant {
use c... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time.rs | MIT | 27e5b41067d01c0c9fac230c5addb58034201a63 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/27e5b41067d01c0c9fac230c5addb58034201a63/tokio/src/runtime/time.rs | 1 | 60 |
tokio-rs/tokio:tokio/src/runtime/time.rs:2 | pub(crate) type Clock = ();
pub(crate) type Driver = io::Driver;
pub(crate) type Handle = ();
pub(crate) fn create_clock() -> Clock {
()
}
/// Create a new timer driver / handle pair
pub(crate) fn create_driver(io_driver: io::Driver, _clock: Clock) -> (Driver, Handle) {
(io_dri... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time.rs | MIT | 27e5b41067d01c0c9fac230c5addb58034201a63 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/27e5b41067d01c0c9fac230c5addb58034201a63/tokio/src/runtime/time.rs | 41 | 61 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:2 | //! walking lists of timers), it checks this "true when" value, and reschedules
//! based on it.
//!
//! We do, however, also need to track what the expiration time was when we
//! originally registered the timer; this is used to locate the right linked
//! list when the timer is being cancelled.
//! This is referred t... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17/tokio/src/runtime/time/entry.rs | 41 | 100 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:3 | /// time (if registered), or otherwise the result of the timer completing, as
/// well as the registered waker.
///
/// Generally, the `StateCell` is only permitted to be accessed from two contexts:
/// Either a thread holding the corresponding `&mut TimerEntry`, or a thread
/// holding the timer driver lock. The write... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17/tokio/src/runtime/time/entry.rs | 81 | 140 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:4 | waker: AtomicWaker::new(),
}
}
fn is_pending(&self) -> bool {
self.state.load(Ordering::Relaxed) == STATE_PENDING_FIRE
}
/// Returns the current expiration time, or None if not currently scheduled.
fn when(&self) -> Option<u64> {
let cur_state = self.state.load(Ordering::Re... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17/tokio/src/runtime/time/entry.rs | 121 | 180 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:5 | }
}
/// Marks this timer as being moved to the pending list, if its scheduled
/// time is not after `not_after`.
///
/// If the timer is scheduled for a time after `not_after`, returns an Err
/// containing the current scheduled time.
///
/// SAFETY: Must hold the driver lock.
unsaf... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17/tokio/src/runtime/time/entry.rs | 161 | 220 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:6 | /// Fires the timer, setting the result to the provided result.
///
/// Returns:
/// * `Some(waker)` - if fired and a waker needs to be invoked once the
/// driver lock is released
/// * `None` - if fired and a waker does not need to be invoked, or if
/// already fired
///
/// SAFETY... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17/tokio/src/runtime/time/entry.rs | 201 | 260 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:7 | // We can use relaxed ordering because we hold the driver lock and will
// fence when we release the lock.
self.state.store(timestamp, Ordering::Relaxed);
}
/// Attempts to adjust the timer to a new timestamp.
///
/// If the timer has already been fired, is pending firing, or the new
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17/tokio/src/runtime/time/entry.rs | 241 | 300 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:8 | // A timer entry.
//
// This is the handle to a timer that is controlled by the requester of the
// timer. As this participates in intrusive data structures, it must be pinned
// before polling.
#[derive(Debug)]
pub(crate) struct TimerEntry {
// Arc reference to the runtime handle. We ca... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17/tokio/src/runtime/time/entry.rs | 281 | 340 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:9 | /// that the timer does still exist; however, normally an `TimerHandle` is created
/// immediately before registering the timer, and is consumed when firing the
/// timer, to help minimize mistakes. Still, because `TimerHandle` cannot enforce
/// memory safety, all operations are unsafe.
#[derive(Debug)]
pub(crate) str... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17/tokio/src/runtime/time/entry.rs | 321 | 380 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:10 | unsafe impl Send for TimerShared {}
unsafe impl Sync for TimerShared {}
impl std::fmt::Debug for TimerShared {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("TimerShared")
.field(
"registered_when",
&self.registered_when.load... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17/tokio/src/runtime/time/entry.rs | 361 | 420 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:11 | /// Gets the true time-of-expiration value, and copies it into the cached
/// time-of-expiration value.
///
/// SAFETY: Must be called with the driver lock held, and when this entry is
/// not in any timer wheel lists.
pub(super) unsafe fn sync_when(&self) -> u64 {
let true_when = self.true_... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17/tokio/src/runtime/time/entry.rs | 401 | 460 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:12 | /// Returns a `TimerHandle` for this timer.
pub(super) fn handle(&self) -> TimerHandle {
TimerHandle {
inner: NonNull::from(self),
}
}
/// Returns true if the state of this timer indicates that the timer might
/// be registered with the driver. This check is performed with r... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17/tokio/src/runtime/time/entry.rs | 441 | 500 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:13 | #[track_caller]
pub(crate) fn new(handle: scheduler::Handle, deadline: Instant) -> Self {
// Panic if the time driver is not enabled
let _ = handle.driver().time();
Self {
driver: handle,
inner: None,
deadline,
registered: false,
}
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17/tokio/src/runtime/time/entry.rs | 481 | 540 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:14 | // but now it is not in the wheel, it means that it has been
// fired.
//
// +--------------+-----------------+----------+
// | deregistered | self.registered | output |
// +--------------+-----------------+----------+
// | true | false | false | <-... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17/tokio/src/runtime/time/entry.rs | 521 | 580 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:15 | //
// The lock acquisition in clear_entry serves this purpose. All of the
// driver manipulations happen with the lock held, so we can just take
// the lock and be sure that this drop happens-after everything the
// driver did so far and happens-before everything the driver does in
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17/tokio/src/runtime/time/entry.rs | 561 | 620 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:16 | ) -> Poll<Result<(), super::Error>> {
assert!(
!self.driver().is_shutdown(),
"{}",
crate::util::error::RUNTIME_SHUTTING_DOWN_ERROR
);
if !self.registered {
let deadline = self.deadline;
self.as_mut().reset(deadline, true);
}
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17/tokio/src/runtime/time/entry.rs | 601 | 660 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:17 | /// Forcibly sets the true and cached expiration times to the given tick.
///
/// SAFETY: The caller must ensure that the handle remains valid, the driver
/// lock is held, and that the timer is not in any wheel linked lists.
pub(super) unsafe fn set_expiration(&self, tick: u64) {
unsafe {
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17/tokio/src/runtime/time/entry.rs | 641 | 693 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:18 | ///
/// Because the entry might be dropped after the state is moved to a
/// terminal state, this function consumes the handle to ensure we don't
/// access the entry afterwards.
///
/// Returns the last-registered waker, if any.
///
/// SAFETY: The driver lock must be held while invoking th... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17/tokio/src/runtime/time/entry.rs | 681 | 693 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:12 | /// Returns a `TimerHandle` for this timer.
pub(super) fn handle(&self) -> TimerHandle {
TimerHandle {
inner: NonNull::from(self),
}
}
/// Returns true if the state of this timer indicates that the timer might
/// be registered with the driver. This check is performed with r... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | 9563707aaa73a802fa4d3c51c12869a037641070 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/9563707aaa73a802fa4d3c51c12869a037641070/tokio/src/runtime/time/entry.rs | 441 | 500 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:16 | ) -> Poll<Result<(), super::Error>> {
assert!(
!self.driver().is_shutdown(),
"{}",
crate::util::error::RUNTIME_SHUTTING_DOWN_ERROR
);
if !self.registered {
let deadline = self.deadline;
self.as_mut().reset(deadline, true);
}
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | 9563707aaa73a802fa4d3c51c12869a037641070 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/9563707aaa73a802fa4d3c51c12869a037641070/tokio/src/runtime/time/entry.rs | 601 | 660 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:17 | /// Forcibly sets the true and cached expiration times to the given tick.
///
/// SAFETY: The caller must ensure that the handle remains valid, the driver
/// lock is held, and that the timer is not in any wheel linked lists.
pub(super) unsafe fn set_expiration(&self, tick: u64) {
self.inner.as_... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | 9563707aaa73a802fa4d3c51c12869a037641070 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/9563707aaa73a802fa4d3c51c12869a037641070/tokio/src/runtime/time/entry.rs | 641 | 687 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:2 | //! walking lists of timers), it checks this "true when" value, and reschedules
//! based on it.
//!
//! We do, however, also need to track what the expiration time was when we
//! originally registered the timer; this is used to locate the right linked
//! list when the timer is being cancelled.
//! This is referred t... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | 7ec77a067739ea2203c506fbfe6bc4aca1139ea7 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/7ec77a067739ea2203c506fbfe6bc4aca1139ea7/tokio/src/runtime/time/entry.rs | 41 | 100 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:3 | /// well as the registered waker.
///
/// Generally, the `StateCell` is only permitted to be accessed from two contexts:
/// Either a thread holding the corresponding `&mut TimerEntry`, or a thread
/// holding the timer driver lock. The write actions on the `StateCell` amount to
/// passing "ownership" of the `StateCel... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | 7ec77a067739ea2203c506fbfe6bc4aca1139ea7 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/7ec77a067739ea2203c506fbfe6bc4aca1139ea7/tokio/src/runtime/time/entry.rs | 81 | 140 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:4 | }
}
fn is_pending(&self) -> bool {
self.state.load(Ordering::Relaxed) == STATE_PENDING_FIRE
}
/// Returns the current expiration time, or None if not currently scheduled.
fn when(&self) -> Option<u64> {
let cur_state = self.state.load(Ordering::Relaxed);
if cur_state == ST... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | 7ec77a067739ea2203c506fbfe6bc4aca1139ea7 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/7ec77a067739ea2203c506fbfe6bc4aca1139ea7/tokio/src/runtime/time/entry.rs | 121 | 180 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:5 | }
/// Marks this timer as being moved to the pending list, if its scheduled
/// time is not after `not_after`.
///
/// If the timer is scheduled for a time after `not_after`, returns an Err
/// containing the current scheduled time.
///
/// SAFETY: Must hold the driver lock.
unsafe fn m... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | 7ec77a067739ea2203c506fbfe6bc4aca1139ea7 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/7ec77a067739ea2203c506fbfe6bc4aca1139ea7/tokio/src/runtime/time/entry.rs | 161 | 220 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:6 | /// Fires the timer, setting the result to the provided result.
///
/// Returns:
/// * `Some(waker)` - if fired and a waker needs to be invoked once the
/// driver lock is released
/// * `None` - if fired and a waker does not need to be invoked, or if
/// already fired
///
/// SAFETY... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | 7ec77a067739ea2203c506fbfe6bc4aca1139ea7 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/7ec77a067739ea2203c506fbfe6bc4aca1139ea7/tokio/src/runtime/time/entry.rs | 201 | 260 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:7 | // fence when we release the lock.
self.state.store(timestamp, Ordering::Relaxed);
}
/// Attempts to adjust the timer to a new timestamp.
///
/// If the timer has already been fired, is pending firing, or the new
/// timestamp is earlier than the old timestamp, (or occasionally
/// spur... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | 7ec77a067739ea2203c506fbfe6bc4aca1139ea7 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/7ec77a067739ea2203c506fbfe6bc4aca1139ea7/tokio/src/runtime/time/entry.rs | 241 | 300 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:8 | /// This is the handle to a timer that is controlled by the requester of the
/// timer. As this participates in intrusive data structures, it must be pinned
/// before polling.
#[derive(Debug)]
pub(crate) struct TimerEntry {
/// Arc reference to the runtime handle. We can only free the driver after
/// deregist... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | 7ec77a067739ea2203c506fbfe6bc4aca1139ea7 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/7ec77a067739ea2203c506fbfe6bc4aca1139ea7/tokio/src/runtime/time/entry.rs | 281 | 340 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:9 | pub(super) type EntryList = crate::util::linked_list::LinkedList<TimerShared, TimerShared>;
/// The shared state structure of a timer. This structure is shared between the
/// frontend (`Entry`) and driver backend.
///
/// Note that this structure is located inside the `TimerEntry` structure.
pub(crate) struct TimerSh... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | 7ec77a067739ea2203c506fbfe6bc4aca1139ea7 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/7ec77a067739ea2203c506fbfe6bc4aca1139ea7/tokio/src/runtime/time/entry.rs | 321 | 380 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:10 | "registered_when",
&self.registered_when.load(Ordering::Relaxed),
)
.field("state", &self.state)
.finish()
}
}
generate_addr_of_methods! {
impl<> TimerShared {
unsafe fn addr_of_pointers(self: NonNull<Self>) -> NonNull<linked_list::Pointers<TimerShare... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | 7ec77a067739ea2203c506fbfe6bc4aca1139ea7 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/7ec77a067739ea2203c506fbfe6bc4aca1139ea7/tokio/src/runtime/time/entry.rs | 361 | 420 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:11 | self.registered_when.store(true_when, Ordering::Relaxed);
true_when
}
/// Sets the cached time-of-expiration value.
///
/// SAFETY: Must be called with the driver lock held, and when this entry is
/// not in any timer wheel lists.
unsafe fn set_registered_when(&self, when: u64) {
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | 7ec77a067739ea2203c506fbfe6bc4aca1139ea7 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/7ec77a067739ea2203c506fbfe6bc4aca1139ea7/tokio/src/runtime/time/entry.rs | 401 | 460 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:12 | /// Returns true if the state of this timer indicates that the timer might
/// be registered with the driver. This check is performed with relaxed
/// ordering, but is conservative - if it returns false, the timer is
/// definitely _not_ registered.
pub(super) fn might_be_registered(&self) -> bool {
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | 7ec77a067739ea2203c506fbfe6bc4aca1139ea7 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/7ec77a067739ea2203c506fbfe6bc4aca1139ea7/tokio/src/runtime/time/entry.rs | 441 | 500 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:13 | deadline,
registered: false,
_m: std::marker::PhantomPinned,
}
}
fn inner(&self) -> Option<&TimerShared> {
self.inner.as_ref()
}
fn init_inner(&mut self) {
match self.inner {
Some(_) => {}
None => self.inner = Some(TimerShared::ne... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | 7ec77a067739ea2203c506fbfe6bc4aca1139ea7 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/7ec77a067739ea2203c506fbfe6bc4aca1139ea7/tokio/src/runtime/time/entry.rs | 481 | 540 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:14 | // some other non-timer use. However, we've been doing a bunch of
// relaxed (or even non-atomic) writes from the driver thread, and we'll
// be doing more from _this thread_ (as this memory is interpreted as
// something else).
//
// It is critical to ensure that, from the point... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | 7ec77a067739ea2203c506fbfe6bc4aca1139ea7 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/7ec77a067739ea2203c506fbfe6bc4aca1139ea7/tokio/src/runtime/time/entry.rs | 521 | 580 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:15 | if reregister {
unsafe {
this.driver()
.reregister(&this.driver.driver().io, tick, inner.into());
}
}
}
pub(crate) fn poll_elapsed(
mut self: Pin<&mut Self>,
cx: &mut Context<'_>,
) -> Poll<Result<(), super::Error>> {
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | 7ec77a067739ea2203c506fbfe6bc4aca1139ea7 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/7ec77a067739ea2203c506fbfe6bc4aca1139ea7/tokio/src/runtime/time/entry.rs | 561 | 620 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:16 | pub(super) unsafe fn registered_when(&self) -> u64 {
unsafe { self.inner.as_ref().registered_when() }
}
pub(super) unsafe fn sync_when(&self) -> u64 {
unsafe { self.inner.as_ref().sync_when() }
}
pub(super) unsafe fn is_pending(&self) -> bool {
unsafe { self.inner.as_ref().stat... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | 7ec77a067739ea2203c506fbfe6bc4aca1139ea7 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/7ec77a067739ea2203c506fbfe6bc4aca1139ea7/tokio/src/runtime/time/entry.rs | 601 | 660 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:17 | }
}
/// Attempts to transition to a terminal state. If the state is already a
/// terminal state, does nothing.
///
/// Because the entry might be dropped after the state is moved to a
/// terminal state, this function consumes the handle to ensure we don't
/// access the entry afterwards.
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | 7ec77a067739ea2203c506fbfe6bc4aca1139ea7 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/7ec77a067739ea2203c506fbfe6bc4aca1139ea7/tokio/src/runtime/time/entry.rs | 641 | 664 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:2 | //! walking lists of timers), it checks this "true when" value, and reschedules
//! based on it.
//!
//! We do, however, also need to track what the expiration time was when we
//! originally registered the timer; this is used to locate the right linked
//! list when the timer is being cancelled.
//! This is referred t... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | ea30a5ea5eee1b3970052f19e8a8b16d0a5c29f4 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/ea30a5ea5eee1b3970052f19e8a8b16d0a5c29f4/tokio/src/runtime/time/entry.rs | 41 | 100 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:7 | // We can use relaxed ordering because we hold the driver lock and will
// fence when we release the lock.
self.state.store(timestamp, Ordering::Relaxed);
}
/// Attempts to adjust the timer to a new timestamp.
///
/// If the timer has already been fired, is pending firing, or the new
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | ea30a5ea5eee1b3970052f19e8a8b16d0a5c29f4 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/ea30a5ea5eee1b3970052f19e8a8b16d0a5c29f4/tokio/src/runtime/time/entry.rs | 241 | 300 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:8 | ///
/// This is the handle to a timer that is controlled by the requester of the
/// timer. As this participates in intrusive data structures, it must be pinned
/// before polling.
#[derive(Debug)]
pub(crate) struct TimerEntry {
/// Arc reference to the runtime handle. We can only free the driver after
/// dere... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | ea30a5ea5eee1b3970052f19e8a8b16d0a5c29f4 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/ea30a5ea5eee1b3970052f19e8a8b16d0a5c29f4/tokio/src/runtime/time/entry.rs | 281 | 340 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:9 | inner: NonNull<TimerShared>,
}
pub(super) type EntryList = crate::util::linked_list::LinkedList<TimerShared, TimerShared>;
/// The shared state structure of a timer. This structure is shared between the
/// frontend (`Entry`) and driver backend.
///
/// Note that this structure is located inside the `TimerEntry` stru... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | ea30a5ea5eee1b3970052f19e8a8b16d0a5c29f4 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/ea30a5ea5eee1b3970052f19e8a8b16d0a5c29f4/tokio/src/runtime/time/entry.rs | 321 | 380 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:10 | f.debug_struct("TimerShared")
.field(
"registered_when",
&self.registered_when.load(Ordering::Relaxed),
)
.field("state", &self.state)
.finish()
}
}
generate_addr_of_methods! {
impl<> TimerShared {
unsafe fn addr_of_pointer... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | ea30a5ea5eee1b3970052f19e8a8b16d0a5c29f4 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/ea30a5ea5eee1b3970052f19e8a8b16d0a5c29f4/tokio/src/runtime/time/entry.rs | 361 | 420 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:11 | let true_when = self.true_when();
self.registered_when.store(true_when, Ordering::Relaxed);
true_when
}
/// Sets the cached time-of-expiration value.
///
/// SAFETY: Must be called with the driver lock held, and when this entry is
/// not in any timer wheel lists.
unsafe fn se... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | ea30a5ea5eee1b3970052f19e8a8b16d0a5c29f4 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/ea30a5ea5eee1b3970052f19e8a8b16d0a5c29f4/tokio/src/runtime/time/entry.rs | 401 | 460 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:12 | }
/// Returns true if the state of this timer indicates that the timer might
/// be registered with the driver. This check is performed with relaxed
/// ordering, but is conservative - if it returns false, the timer is
/// definitely _not_ registered.
pub(super) fn might_be_registered(&self) -> boo... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | ea30a5ea5eee1b3970052f19e8a8b16d0a5c29f4 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/ea30a5ea5eee1b3970052f19e8a8b16d0a5c29f4/tokio/src/runtime/time/entry.rs | 441 | 500 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:13 | driver: handle,
inner: StdUnsafeCell::new(None),
deadline,
registered: false,
_m: std::marker::PhantomPinned,
}
}
fn is_inner_init(&self) -> bool {
unsafe { &*self.inner.get() }.is_some()
}
// This lazy initialization is for performance p... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | ea30a5ea5eee1b3970052f19e8a8b16d0a5c29f4 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/ea30a5ea5eee1b3970052f19e8a8b16d0a5c29f4/tokio/src/runtime/time/entry.rs | 481 | 540 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:14 | // Why is this necessary? We're about to release this timer's memory for
// some other non-timer use. However, we've been doing a bunch of
// relaxed (or even non-atomic) writes from the driver thread, and we'll
// be doing more from _this thread_ (as this memory is interpreted as
// som... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | ea30a5ea5eee1b3970052f19e8a8b16d0a5c29f4 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/ea30a5ea5eee1b3970052f19e8a8b16d0a5c29f4/tokio/src/runtime/time/entry.rs | 521 | 580 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:15 | pub(crate) fn poll_elapsed(
mut self: Pin<&mut Self>,
cx: &mut Context<'_>,
) -> Poll<Result<(), super::Error>> {
assert!(
!self.driver().is_shutdown(),
"{}",
crate::util::error::RUNTIME_SHUTTING_DOWN_ERROR
);
if !self.registered {
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | ea30a5ea5eee1b3970052f19e8a8b16d0a5c29f4 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/ea30a5ea5eee1b3970052f19e8a8b16d0a5c29f4/tokio/src/runtime/time/entry.rs | 561 | 620 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:16 | }
/// Forcibly sets the true and cached expiration times to the given tick.
///
/// SAFETY: The caller must ensure that the handle remains valid, the driver
/// lock is held, and that the timer is not in any wheel linked lists.
pub(super) unsafe fn set_expiration(&self, tick: u64) {
self.in... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | ea30a5ea5eee1b3970052f19e8a8b16d0a5c29f4 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/ea30a5ea5eee1b3970052f19e8a8b16d0a5c29f4/tokio/src/runtime/time/entry.rs | 601 | 654 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:17 | /// Returns the last-registered waker, if any.
///
/// SAFETY: The driver lock must be held while invoking this function, and
/// the entry must not be in any wheel linked lists.
pub(super) unsafe fn fire(self, completed_state: TimerResult) -> Option<Waker> {
self.inner.as_ref().state.fire(compl... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | ea30a5ea5eee1b3970052f19e8a8b16d0a5c29f4 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/ea30a5ea5eee1b3970052f19e8a8b16d0a5c29f4/tokio/src/runtime/time/entry.rs | 641 | 654 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:2 | //! walking lists of timers), it checks this "true when" value, and reschedules
//! based on it.
//!
//! We do, however, also need to track what the expiration time was when we
//! originally registered the timer; this is used to locate the right linked
//! list when the timer is being cancelled. This is referred to as... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | 4cbcb687f429f2a4cee948b0462e23f86ef95822 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/4cbcb687f429f2a4cee948b0462e23f86ef95822/tokio/src/runtime/time/entry.rs | 41 | 100 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:8 | ///
/// This is the handle to a timer that is controlled by the requester of the
/// timer. As this participates in intrusive data structures, it must be pinned
/// before polling.
#[derive(Debug)]
pub(crate) struct TimerEntry {
/// Arc reference to the runtime handle. We can only free the driver after
/// dere... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | 4cbcb687f429f2a4cee948b0462e23f86ef95822 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/4cbcb687f429f2a4cee948b0462e23f86ef95822/tokio/src/runtime/time/entry.rs | 281 | 340 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:9 | inner: NonNull<TimerShared>,
}
pub(super) type EntryList = crate::util::linked_list::LinkedList<TimerShared, TimerShared>;
/// The shared state structure of a timer. This structure is shared between the
/// frontend (`Entry`) and driver backend.
///
/// Note that this structure is located inside the `TimerEntry` stru... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | 4cbcb687f429f2a4cee948b0462e23f86ef95822 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/4cbcb687f429f2a4cee948b0462e23f86ef95822/tokio/src/runtime/time/entry.rs | 321 | 380 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:10 | generate_addr_of_methods! {
impl<> TimerShared {
unsafe fn addr_of_pointers(self: NonNull<Self>) -> NonNull<linked_list::Pointers<TimerShared>> {
&self.pointers
}
}
}
impl TimerShared {
pub(super) fn new() -> Self {
Self {
cached_when: AtomicU64::new(0),
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | 4cbcb687f429f2a4cee948b0462e23f86ef95822 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/4cbcb687f429f2a4cee948b0462e23f86ef95822/tokio/src/runtime/time/entry.rs | 361 | 420 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:11 | /// SAFETY: Must be called with the driver lock held, and when this entry is
/// not in any timer wheel lists.
unsafe fn set_cached_when(&self, when: u64) {
self.cached_when.store(when, Ordering::Relaxed);
}
/// Returns the true time-of-expiration value, with relaxed memory ordering.
pub(su... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | 4cbcb687f429f2a4cee948b0462e23f86ef95822 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/4cbcb687f429f2a4cee948b0462e23f86ef95822/tokio/src/runtime/time/entry.rs | 401 | 460 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:12 | }
unsafe impl linked_list::Link for TimerShared {
type Handle = TimerHandle;
type Target = TimerShared;
fn as_raw(handle: &Self::Handle) -> NonNull<Self::Target> {
handle.inner
}
unsafe fn from_raw(ptr: NonNull<Self::Target>) -> Self::Handle {
TimerHandle { inner: ptr }
}
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | 4cbcb687f429f2a4cee948b0462e23f86ef95822 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/4cbcb687f429f2a4cee948b0462e23f86ef95822/tokio/src/runtime/time/entry.rs | 441 | 500 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:13 | unsafe { &*self.inner.get() }.is_some()
}
// This lazy initialization is for performance purposes.
fn inner(&self) -> &TimerShared {
let inner = unsafe { &*self.inner.get() };
if inner.is_none() {
unsafe {
*self.inner.get() = Some(TimerShared::new());
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | 4cbcb687f429f2a4cee948b0462e23f86ef95822 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/4cbcb687f429f2a4cee948b0462e23f86ef95822/tokio/src/runtime/time/entry.rs | 481 | 540 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:14 | // happen-before we drop the timer. This in turn requires us to perform
// an acquire-release barrier in _both_ directions between the driver
// and dropping thread.
//
// The lock acquisition in clear_entry serves this purpose. All of the
// driver manipulations happen with the ... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | 4cbcb687f429f2a4cee948b0462e23f86ef95822 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/4cbcb687f429f2a4cee948b0462e23f86ef95822/tokio/src/runtime/time/entry.rs | 521 | 580 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:15 | );
if !self.registered {
let deadline = self.deadline;
self.as_mut().reset(deadline, true);
}
self.inner().state.poll(cx.waker())
}
pub(crate) fn driver(&self) -> &super::Handle {
self.driver.driver().time()
}
#[cfg(all(tokio_unstable, feature ... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | 4cbcb687f429f2a4cee948b0462e23f86ef95822 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/4cbcb687f429f2a4cee948b0462e23f86ef95822/tokio/src/runtime/time/entry.rs | 561 | 620 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:16 | /// Attempts to mark this entry as pending. If the expiration time is after
/// `not_after`, however, returns an Err with the current expiration time.
///
/// If an `Err` is returned, the `cached_when` value will be updated to this
/// new expiration time.
///
/// SAFETY: The caller must ensure ... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | 4cbcb687f429f2a4cee948b0462e23f86ef95822 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/4cbcb687f429f2a4cee948b0462e23f86ef95822/tokio/src/runtime/time/entry.rs | 601 | 645 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:2 | //! walking lists of timers), it checks this "true when" value, and reschedules
//! based on it.
//!
//! We do, however, also need to track what the expiration time was when we
//! originally registered the timer; this is used to locate the right linked
//! list when the timer is being cancelled. This is referred to as... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | 1ae9434e8e4a419ce25644e6c8d2b2e2e8c34750 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/1ae9434e8e4a419ce25644e6c8d2b2e2e8c34750/tokio/src/runtime/time/entry.rs | 41 | 100 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:7 | // We can use relaxed ordering because we hold the driver lock and will
// fence when we release the lock.
self.state.store(timestamp, Ordering::Relaxed);
}
/// Attempts to adjust the timer to a new timestamp.
///
/// If the timer has already been fired, is pending firing, or the new
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | 1ae9434e8e4a419ce25644e6c8d2b2e2e8c34750 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/1ae9434e8e4a419ce25644e6c8d2b2e2e8c34750/tokio/src/runtime/time/entry.rs | 241 | 300 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:15 | );
if !self.registered {
let deadline = self.deadline;
self.as_mut().reset(deadline, true);
}
self.inner().state.poll(cx.waker())
}
pub(crate) fn driver(&self) -> &super::Handle {
self.driver.driver().time()
}
#[cfg(all(tokio_unstable, feature ... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | 1ae9434e8e4a419ce25644e6c8d2b2e2e8c34750 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/1ae9434e8e4a419ce25644e6c8d2b2e2e8c34750/tokio/src/runtime/time/entry.rs | 561 | 620 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:16 | /// Attempts to mark this entry as pending. If the expiration time is after
/// `not_after`, however, returns an Err with the current expiration time.
///
/// If an `Err` is returned, the `cached_when` value will be updated to this
/// new expiration time.
///
/// SAFETY: The caller must ensure ... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | 1ae9434e8e4a419ce25644e6c8d2b2e2e8c34750 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/1ae9434e8e4a419ce25644e6c8d2b2e2e8c34750/tokio/src/runtime/time/entry.rs | 601 | 645 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:2 | //! walking lists of timers), it checks this "true when" value, and reschedules
//! based on it.
//!
//! We do, however, also need to track what the expiration time was when we
//! originally registered the timer; this is used to locate the right linked
//! list when the timer is being cancelled. This is referred to as... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | 159a3b2c8587cd12ad54eb16489dad6eb674d4ca | github | async-runtime | https://github.com/tokio-rs/tokio/blob/159a3b2c8587cd12ad54eb16489dad6eb674d4ca/tokio/src/runtime/time/entry.rs | 41 | 100 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:3 | /// This structure holds the current shared state of the timer - its scheduled
/// time (if registered), or otherwise the result of the timer completing, as
/// well as the registered waker.
///
/// Generally, the `StateCell` is only permitted to be accessed from two contexts:
/// Either a thread holding the correspond... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | 159a3b2c8587cd12ad54eb16489dad6eb674d4ca | github | async-runtime | https://github.com/tokio-rs/tokio/blob/159a3b2c8587cd12ad54eb16489dad6eb674d4ca/tokio/src/runtime/time/entry.rs | 81 | 140 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:4 | result: UnsafeCell::new(Ok(())),
waker: AtomicWaker::new(),
}
}
fn is_pending(&self) -> bool {
self.state.load(Ordering::Relaxed) == STATE_PENDING_FIRE
}
/// Returns the current expiration time, or None if not currently scheduled.
fn when(&self) -> Option<u64> {
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | 159a3b2c8587cd12ad54eb16489dad6eb674d4ca | github | async-runtime | https://github.com/tokio-rs/tokio/blob/159a3b2c8587cd12ad54eb16489dad6eb674d4ca/tokio/src/runtime/time/entry.rs | 121 | 180 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:5 | Poll::Pending
}
}
/// Marks this timer as being moved to the pending list, if its scheduled
/// time is not after `not_after`.
///
/// If the timer is scheduled for a time after `not_after`, returns an Err
/// containing the current scheduled time.
///
/// SAFETY: Must hold the ... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | 159a3b2c8587cd12ad54eb16489dad6eb674d4ca | github | async-runtime | https://github.com/tokio-rs/tokio/blob/159a3b2c8587cd12ad54eb16489dad6eb674d4ca/tokio/src/runtime/time/entry.rs | 161 | 220 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:6 | }
/// Fires the timer, setting the result to the provided result.
///
/// Returns:
/// * `Some(waker)` - if fired and a waker needs to be invoked once the
/// driver lock is released
/// * `None` - if fired and a waker does not need to be invoked, or if
/// already fired
///
///... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | 159a3b2c8587cd12ad54eb16489dad6eb674d4ca | github | async-runtime | https://github.com/tokio-rs/tokio/blob/159a3b2c8587cd12ad54eb16489dad6eb674d4ca/tokio/src/runtime/time/entry.rs | 201 | 260 |
tokio-rs/tokio:tokio/src/runtime/time/entry.rs:7 | // We can use relaxed ordering because we hold the driver lock and will
// fence when we release the lock.
self.state.store(timestamp, Ordering::Relaxed);
}
/// Attempts to adjust the timer to a new timestamp.
///
/// If the timer has already been fired, is pending firing, or the new
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time/entry.rs | MIT | 159a3b2c8587cd12ad54eb16489dad6eb674d4ca | github | async-runtime | https://github.com/tokio-rs/tokio/blob/159a3b2c8587cd12ad54eb16489dad6eb674d4ca/tokio/src/runtime/time/entry.rs | 241 | 300 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.