Data Structures | Macros | Functions

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

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

Data Structures

struct  txlist_entry
 Represents an entry in a transaction-safe list. More...
 
struct  txlist_state
 The global state of transaction-safe list. More...
 

Macros

#define __TXLIST_ENTRY_INITIALIZER(_value)
 Initializer macro for struct txlist_entry. More...
 
#define TXLIST_ENTRY_INITIALIZER
 Initializer macro for struct txlist_entry.
 
#define TXLIST_STATE_INITIALIZER(list_state)
 Initializer macro for struct txlist_state.
 

Functions

PICOTM_NOTHROW void txlist_entry_init (struct txlist_entry *self)
 Initializes an entry of a transactional list. More...
 
PICOTM_NOTHROW struct txlist_entrytxlist_entry_next_tx (const struct txlist_entry *self)
 Returns the next list entry. More...
 
PICOTM_NOTHROW struct txlist_entrytxlist_entry_prev_tx (const struct txlist_entry *self)
 Returns the previous list entry. More...
 
PICOTM_NOTHROW void txlist_entry_uninit (struct txlist_entry *self)
 Cleans up an entry of a transactional list. More...
 
PICOTM_NOTHROW void txlist_state_clear_and_uninit_entries (struct txlist_state *self, void(*uninit)(struct txlist_entry *, void *), void *data)
 Removes all entries from a list state and runs a cleanup function on each. More...
 
PICOTM_NOTHROW void txlist_state_init (struct txlist_state *self)
 Initializes list state. More...
 
PICOTM_NOTHROW void txlist_state_uninit (struct txlist_state *self)
 Cleans up list state. More...
 

Macro Definition Documentation

◆ __TXLIST_ENTRY_INITIALIZER

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

Function Documentation

◆ txlist_entry_init()

PICOTM_NOTHROW void txlist_entry_init ( struct txlist_entry self)
Parameters
selfThe list entry to initialize.

◆ txlist_entry_next_tx()

PICOTM_NOTHROW struct txlist_entry* txlist_entry_next_tx ( const struct txlist_entry self)
Parameters
selfThe current list entry.
Returns
The next list entry.

◆ txlist_entry_prev_tx()

PICOTM_NOTHROW struct txlist_entry* txlist_entry_prev_tx ( const struct txlist_entry self)
Parameters
selfThe current list entry.
Returns
The previous list entry.

◆ txlist_entry_uninit()

PICOTM_NOTHROW void txlist_entry_uninit ( struct txlist_entry self)
Parameters
selfThe list entry to clean up.

◆ txlist_state_clear_and_uninit_entries()

PICOTM_NOTHROW void txlist_state_clear_and_uninit_entries ( struct txlist_state self,
void(*)(struct txlist_entry *, void *)  uninit,
void *  data 
)
Parameters
selfThe list state to clear.
uninitThe list-entry clean-up function.
dataThe clean-up function's data parameter.

◆ txlist_state_init()

PICOTM_NOTHROW void txlist_state_init ( struct txlist_state self)
Parameters
selfThe list state to initialize.

◆ txlist_state_uninit()

PICOTM_NOTHROW void txlist_state_uninit ( struct txlist_state self)
Parameters
selfThe list state to clean up.