picotm  0.9.0
Data Structures | Macros | Functions
picotm-txstack-state.h File Reference

Provides non-transactional state and entries for transactional stacks. More...

#include <picotm/compiler.h>
#include <picotm/config/picotm-txlib-config.h>
#include <picotm/picotm-lib-rwlock.h>
#include <stddef.h>

Data Structures

struct  txstack_entry
 Represents an entry in a transaction-safe stack. More...
 
struct  txstack_state
 The global state of transaction-safe stack. More...
 

Macros

#define __TXSTACK_ENTRY_INITIALIZER(_value)
 Initializer macro for struct txstack_entry. More...
 
#define TXSTACK_ENTRY_INITIALIZER
 Initializer macro for struct txstack_entry.
 
#define TXSTACK_STATE_INITIALIZER(stack_state)
 Initializer macro for struct txstack_state.
 

Functions

PICOTM_NOTHROW void txstack_entry_init (struct txstack_entry *self)
 Initializes an entry of a transactional stack. More...
 
PICOTM_NOTHROW void txstack_entry_uninit (struct txstack_entry *self)
 Cleans up an entry of a transactional stack. More...
 
PICOTM_NOTHROW void txstack_state_clear_and_uninit_entries (struct txstack_state *self, void(*uninit)(struct txstack_entry *, void *), void *data)
 Removes all entries from a stack state and runs a cleanup function on each. More...
 
PICOTM_NOTHROW void txstack_state_init (struct txstack_state *self)
 Initializes stack state. More...
 
PICOTM_NOTHROW void txstack_state_uninit (struct txstack_state *self)
 Cleans up stack state. More...
 

Macro Definition Documentation

◆ __TXSTACK_ENTRY_INITIALIZER

#define __TXSTACK_ENTRY_INITIALIZER (   _value)
Warning
This is an internal interface. Don't use it in application code.

Function Documentation

◆ txstack_entry_init()

PICOTM_NOTHROW void txstack_entry_init ( struct txstack_entry self)
Parameters
selfThe stack entry to initialize.

◆ txstack_entry_uninit()

PICOTM_NOTHROW void txstack_entry_uninit ( struct txstack_entry self)
Parameters
selfThe stack entry to clean up.

◆ txstack_state_clear_and_uninit_entries()

PICOTM_NOTHROW void txstack_state_clear_and_uninit_entries ( struct txstack_state self,
void(*)(struct txstack_entry *, void *)  uninit,
void *  data 
)
Parameters
selfThe stack state to clear.
uninitThe stack-entry clean-up function.
dataThe clean-up function's data parameter.

◆ txstack_state_init()

PICOTM_NOTHROW void txstack_state_init ( struct txstack_state self)
Parameters
selfThe stack state to initialize.

◆ txstack_state_uninit()

PICOTM_NOTHROW void txstack_state_uninit ( struct txstack_state self)
Parameters
selfThe stack state to clean up.