pub enum CpuThreadExecution {
Idle,
SharedScope,
Active,
}Expand description
What CPU execution the current thread is inside.
An owner that serializes callers with a blocking lock (such as an eager runtime’s backend owner) must not wait on that lock while this thread holds a CPU execution permit: another thread may hold the owner and wait for the permit (#1946 F1).
§Examples
use tenferro_cpu::{current_cpu_execution, CpuBackend, CpuThreadExecution};
assert_eq!(current_cpu_execution(), CpuThreadExecution::Idle);
let backend = CpuBackend::with_threads(1)?;
assert_eq!(backend.install(current_cpu_execution)?, CpuThreadExecution::Active);
let in_scope = backend.with_execution_scope(current_cpu_execution)?;
assert_eq!(in_scope, CpuThreadExecution::SharedScope);Variants§
Idle
No CPU execution holds a permit on this thread.
A shared execution scope holds a permit, and none of its operations is running: an operation or session may still be admitted under it.
Active
A CPU operation or session is running; nested entry is rejected.
Trait Implementations§
Source§impl Clone for CpuThreadExecution
impl Clone for CpuThreadExecution
Source§fn clone(&self) -> CpuThreadExecution
fn clone(&self) -> CpuThreadExecution
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for CpuThreadExecution
Source§impl Debug for CpuThreadExecution
impl Debug for CpuThreadExecution
impl Eq for CpuThreadExecution
Source§impl PartialEq for CpuThreadExecution
impl PartialEq for CpuThreadExecution
impl StructuralPartialEq for CpuThreadExecution
Auto Trait Implementations§
impl Freeze for CpuThreadExecution
impl RefUnwindSafe for CpuThreadExecution
impl Send for CpuThreadExecution
impl Sync for CpuThreadExecution
impl Unpin for CpuThreadExecution
impl UnsafeUnpin for CpuThreadExecution
impl UnwindSafe for CpuThreadExecution
Blanket Implementations§
impl<T> Boilerplate for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
impl<T, U> Imply<T> for U
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more