picotm  0.10.0
Functions

Provides transactional stacks. More...

#include <picotm/compiler.h>
#include <picotm/config/picotm-txlib-config.h>
#include <stdbool.h>
#include <stddef.h>
#include "picotm-txstack-state.h"

Functions

PICOTM_NOTHROW bool txstack_empty_tx (struct txstack *self)
 Tests a transactional stack for emptiness. More...
 
PICOTM_NOTHROW void txstack_entry_init_tm (struct txstack_entry *self)
 Initializes an entry of a transactional stack from within a transaction. More...
 
PICOTM_NOTHROW void txstack_entry_uninit_tm (struct txstack_entry *self)
 Cleans up an entry of a transactional stack from within a transaction. More...
 
PICOTM_NOTHROW struct txstacktxstack_of_state_tx (struct txstack_state *stack_state)
 Creates a transactional stack for a stack state. More...
 
PICOTM_NOTHROW void txstack_pop_tx (struct txstack *self)
 Removes the top-most entry of a transactional stack. More...
 
PICOTM_NOTHROW void txstack_push_tx (struct txstack *self, struct txstack_entry *entry)
 Inserts an entry at the top of a transactional stack. More...
 
PICOTM_NOTHROW size_t txstack_size_tx (struct txstack *self)
 Returns the number of entries on a transactional stack. More...
 
PICOTM_NOTHROW struct txstack_entrytxstack_top_tx (struct txstack *self)
 Returns the top-most entry of a transactional stack. More...
 

Function Documentation

◆ txstack_empty_tx()

PICOTM_NOTHROW bool txstack_empty_tx ( struct txstack self)
Parameters
selfThe transactional stack.
Returns
True if the stack is empty, false otherwise.

◆ txstack_entry_init_tm()

PICOTM_NOTHROW void txstack_entry_init_tm ( struct txstack_entry self)
Parameters
selfThe stack entry to initialize.
Attention
This function expects the entry's memory to be owned by the calling transaction. Shared-memory locations have to be read/write privatized first.

◆ txstack_entry_uninit_tm()

PICOTM_NOTHROW void txstack_entry_uninit_tm ( struct txstack_entry self)
Parameters
selfThe stack entry to clean up.
Attention
This function expects the entry's memory to be owned by the calling transaction. Shared-memory locations have to be read/write privatized first.

◆ txstack_of_state_tx()

PICOTM_NOTHROW struct txstack* txstack_of_state_tx ( struct txstack_state stack_state)
Parameters
stack_stateThe stack state.
Returns
A transactional stack for the stack state.

◆ txstack_pop_tx()

PICOTM_NOTHROW void txstack_pop_tx ( struct txstack self)
Parameters
selfThe transactional stack.

◆ txstack_push_tx()

PICOTM_NOTHROW void txstack_push_tx ( struct txstack self,
struct txstack_entry entry 
)
Parameters
selfThe transactional stack.
entryThe stack entry to insert.

◆ txstack_size_tx()

PICOTM_NOTHROW size_t txstack_size_tx ( struct txstack self)
Parameters
selfThe transactional stack.
Returns
The number of entries on the transactional stack.

◆ txstack_top_tx()

PICOTM_NOTHROW struct txstack_entry* txstack_top_tx ( struct txstack self)
Parameters
selfThe transactional stack.
Returns
The entry at the transactional stack's front end.