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

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

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

Data Structures

struct  txqueue_entry
 Represents an entry in a transaction-safe queue. More...
 
struct  txqueue_state
 The global state of transaction-safe queue. More...
 

Macros

#define __TXQUEUE_ENTRY_INITIALIZER(_value)
 Initializer macro for struct txqueue_entry. More...
 
#define TXQUEUE_ENTRY_INITIALIZER
 Initializer macro for struct txqueue_entry.
 
#define TXQUEUE_STATE_INITIALIZER(queue_state)
 Initializer macro for struct txqueue_state.
 

Functions

PICOTM_NOTHROW void txqueue_entry_init (struct txqueue_entry *self)
 Initializes an entry of a transactional queue. More...
 
PICOTM_NOTHROW void txqueue_entry_uninit (struct txqueue_entry *self)
 Cleans up an entry of a transactional queue. More...
 
PICOTM_NOTHROW void txqueue_state_clear_and_uninit_entries (struct txqueue_state *self, void(*uninit)(struct txqueue_entry *, void *), void *data)
 Removes all entries from a queue state and runs a cleanup function on each. More...
 
PICOTM_NOTHROW void txqueue_state_init (struct txqueue_state *self)
 Initializes queue state. More...
 
PICOTM_NOTHROW void txqueue_state_uninit (struct txqueue_state *self)
 Cleans up queue state. More...
 

Macro Definition Documentation

◆ __TXQUEUE_ENTRY_INITIALIZER

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

Function Documentation

◆ txqueue_entry_init()

PICOTM_NOTHROW void txqueue_entry_init ( struct txqueue_entry self)
Parameters
selfThe queue entry to initialize.

◆ txqueue_entry_uninit()

PICOTM_NOTHROW void txqueue_entry_uninit ( struct txqueue_entry self)
Parameters
selfThe queue entry to clean up.

◆ txqueue_state_clear_and_uninit_entries()

PICOTM_NOTHROW void txqueue_state_clear_and_uninit_entries ( struct txqueue_state self,
void(*)(struct txqueue_entry *, void *)  uninit,
void *  data 
)
Parameters
selfThe queue state to clear.
uninitThe queue-entry clean-up function.
dataThe clean-up function's data parameter.

◆ txqueue_state_init()

PICOTM_NOTHROW void txqueue_state_init ( struct txqueue_state self)
Parameters
selfThe queue state to initialize.

◆ txqueue_state_uninit()

PICOTM_NOTHROW void txqueue_state_uninit ( struct txqueue_state self)
Parameters
selfThe queue state to clean up.