chore: move doc comments inside macro invocations (#901)

This commit is contained in:
Andy Russell 2019-02-19 16:54:52 -05:00 committed by Carl Lerche
parent dd66096ea0
commit 2d5aa82341
5 changed files with 30 additions and 18 deletions

View File

@ -194,17 +194,21 @@ struct CurrentRunner {
id: Cell<Option<u64>>, id: Cell<Option<u64>>,
} }
/// Current thread's task runner. This is set in `TaskRunner::with` thread_local!{
thread_local!(static CURRENT: CurrentRunner = CurrentRunner { /// Current thread's task runner. This is set in `TaskRunner::with`
spawn: Cell::new(None), static CURRENT: CurrentRunner = CurrentRunner {
id: Cell::new(None), spawn: Cell::new(None),
}); id: Cell::new(None),
}
}
/// Unique ID to assign to each new executor launched on this thread. thread_local!{
/// /// Unique ID to assign to each new executor launched on this thread.
/// The unique ID is used to determine if the currently running executor matches the one referred ///
/// to by a `Handle` so that direct task dispatch can be used. /// The unique ID is used to determine if the currently running executor matches the one
thread_local!(static EXECUTOR_ID: Cell<u64> = Cell::new(0)); /// referred to by a `Handle` so that direct task dispatch can be used.
static EXECUTOR_ID: Cell<u64> = Cell::new(0)
}
/// Run the executor bootstrapping the execution with the provided future. /// Run the executor bootstrapping the execution with the provided future.
/// ///

View File

@ -64,8 +64,10 @@ enum State {
Active Active
} }
/// Thread-local tracking the current executor thread_local!{
thread_local!(static EXECUTOR: Cell<State> = Cell::new(State::Empty)); /// Thread-local tracking the current executor
static EXECUTOR: Cell<State> = Cell::new(State::Empty)
}
// ===== impl DefaultExecutor ===== // ===== impl DefaultExecutor =====

View File

@ -167,8 +167,10 @@ pub(crate) enum Direction {
/// The global fallback reactor. /// The global fallback reactor.
static HANDLE_FALLBACK: AtomicUsize = AtomicUsize::new(0); static HANDLE_FALLBACK: AtomicUsize = AtomicUsize::new(0);
/// Tracks the reactor for the current execution context. thread_local!{
thread_local!(static CURRENT_REACTOR: RefCell<Option<HandlePriv>> = RefCell::new(None)); /// Tracks the reactor for the current execution context.
static CURRENT_REACTOR: RefCell<Option<HandlePriv>> = RefCell::new(None)
}
const TOKEN_SHIFT: usize = 22; const TOKEN_SHIFT: usize = 22;

View File

@ -20,8 +20,10 @@ pub struct Clock {
now: Option<Arc<Now>>, now: Option<Arc<Now>>,
} }
/// Thread-local tracking the current clock thread_local!{
thread_local!(static CLOCK: Cell<Option<*const Clock>> = Cell::new(None)); /// Thread-local tracking the current clock
static CLOCK: Cell<Option<*const Clock>> = Cell::new(None)
}
/// Returns an `Instant` corresponding to "now". /// Returns an `Instant` corresponding to "now".
/// ///

View File

@ -44,8 +44,10 @@ pub(crate) struct HandlePriv {
inner: Weak<Inner>, inner: Weak<Inner>,
} }
/// Tracks the timer for the current execution context. thread_local!{
thread_local!(static CURRENT_TIMER: RefCell<Option<HandlePriv>> = RefCell::new(None)); /// Tracks the timer for the current execution context.
static CURRENT_TIMER: RefCell<Option<HandlePriv>> = RefCell::new(None)
}
/// Set the default timer for the duration of the closure. /// Set the default timer for the duration of the closure.
/// ///