Struct intel_tsx_rtm::HardwareMemoryTransactionManager
[−]
[src]
pub struct HardwareMemoryTransactionManager { /* fields omitted */ }
A simple wrapper to avoid constantly having to check for support of hardware memory transactions.
Methods
impl HardwareMemoryTransactionManager
[src]
fn new() -> Self
[src]
Creates a new instance.
fn execute_transaction_once_gracefully<TransactionCallback: FnMut() -> Result<(), u8>>(
&self,
transaction_callback: TransactionCallback
) -> Result<(), Option<HardwareMemoryTransactionResult>>
[src]
&self,
transaction_callback: TransactionCallback
) -> Result<(), Option<HardwareMemoryTransactionResult>>
Gracefully executes the transaction once if TSX transaction are supported.
If not supported, returns an Err with None.
Use this when executing a transaction for the first time in a loop, then adjust to either TSX specific code (eg calling execute_transaction_once()
which will panic if TSX is not supported) or a software transactional manager.
fn execute_transaction_once<TransactionCallback: FnMut() -> Result<(), u8>>(
&self,
transaction_callback: TransactionCallback
) -> Result<(), HardwareMemoryTransactionResult>
[src]
&self,
transaction_callback: TransactionCallback
) -> Result<(), HardwareMemoryTransactionResult>
Executes the transaction once.
Panics on non x86_64 platforms.
Panics on x86_64 platforms which don't have transactions if running with debug assertions enabled.
TransactionCallback
returns a status code if it wants to explicitly abort.
fn cpu_supports_hardware_transactions(&self) -> bool
[src]
Does this x86_64 CPU have hardware transactions (TSX)? This will always be false for non-x86-64 platforms.
fn is_inside_a_running_transaction(&self) -> bool
[src]
Use this to detect if inside a transaction callback. Always false if TSX transactions are not supported (eg not x86-64, not a recent Intel Skylake CPU). Can be used to prevent nested transactions, and in code meant to run either as a transaction or in a fallback.
Trait Implementations
impl Debug for HardwareMemoryTransactionManager
[src]
impl Copy for HardwareMemoryTransactionManager
[src]
impl Clone for HardwareMemoryTransactionManager
[src]
fn clone(&self) -> HardwareMemoryTransactionManager
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Ord for HardwareMemoryTransactionManager
[src]
fn cmp(&self, __arg_0: &HardwareMemoryTransactionManager) -> Ordering
[src]
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.22.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.22.0[src]
Compares and returns the minimum of two values. Read more
impl PartialOrd for HardwareMemoryTransactionManager
[src]
fn partial_cmp(
&self,
__arg_0: &HardwareMemoryTransactionManager
) -> Option<Ordering>
[src]
&self,
__arg_0: &HardwareMemoryTransactionManager
) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &HardwareMemoryTransactionManager) -> bool
[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &HardwareMemoryTransactionManager) -> bool
[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, __arg_0: &HardwareMemoryTransactionManager) -> bool
[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &HardwareMemoryTransactionManager) -> bool
[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Eq for HardwareMemoryTransactionManager
[src]
impl PartialEq for HardwareMemoryTransactionManager
[src]
fn eq(&self, __arg_0: &HardwareMemoryTransactionManager) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &HardwareMemoryTransactionManager) -> bool
[src]
This method tests for !=
.