Functions

Provides transactional queues. More...

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

Functions

PICOTM_NOTHROW struct txqueue_entrytxqueue_back_tx (struct txqueue *self)
 Retruns the back-end entry of a transactional queue. More...
 
PICOTM_NOTHROW bool txqueue_empty_tx (struct txqueue *self)
 Tests a transactional queue for emptiness. More...
 
PICOTM_NOTHROW void txqueue_entry_init_tm (struct txqueue_entry *self)
 Initializes an entry of a transactional queue from within a transaction. More...
 
PICOTM_NOTHROW void txqueue_entry_uninit_tm (struct txqueue_entry *self)
 Cleans up an entry of a transactional queue. More...
 
PICOTM_NOTHROW struct txqueue_entrytxqueue_front_tx (struct txqueue *self)
 Returns the front-end entry of a transactional queue. More...
 
PICOTM_NOTHROW struct txqueuetxqueue_of_state_tx (struct txqueue_state *queue_state)
 Creates a transactional queue for a queue state. More...
 
PICOTM_NOTHROW void txqueue_pop_tx (struct txqueue *self)
 Removes the last entry of a transactional queue. More...
 
PICOTM_NOTHROW void txqueue_push_tx (struct txqueue *self, struct txqueue_entry *entry)
 Inserts an entry at the front of a transactional queue. More...
 
PICOTM_NOTHROW size_t txqueue_size_tx (struct txqueue *self)
 Returns the number of entries in a transactional queue. More...
 

Function Documentation

◆ txqueue_back_tx()

PICOTM_NOTHROW struct txqueue_entry* txqueue_back_tx ( struct txqueue self)
Parameters
selfThe transactional queue.
Returns
The entry at the transactional queue's back end.

◆ txqueue_empty_tx()

PICOTM_NOTHROW bool txqueue_empty_tx ( struct txqueue self)
Parameters
selfThe transactional queue.
Returns
True if the queue is empty, false otherwise.

◆ txqueue_entry_init_tm()

PICOTM_NOTHROW void txqueue_entry_init_tm ( struct txqueue_entry self)
Parameters
selfThe queue 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.

◆ txqueue_entry_uninit_tm()

PICOTM_NOTHROW void txqueue_entry_uninit_tm ( struct txqueue_entry self)
Parameters
selfThe queue 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.

◆ txqueue_front_tx()

PICOTM_NOTHROW struct txqueue_entry* txqueue_front_tx ( struct txqueue self)
Parameters
selfThe transactional queue.
Returns
The entry at the transactional queue's front end.

◆ txqueue_of_state_tx()

PICOTM_NOTHROW struct txqueue* txqueue_of_state_tx ( struct txqueue_state queue_state)
Parameters
queue_stateThe queue state.
Returns
A transactional queue for the queue state.

◆ txqueue_pop_tx()

PICOTM_NOTHROW void txqueue_pop_tx ( struct txqueue self)
Parameters
selfThe transactional queue.

◆ txqueue_push_tx()

PICOTM_NOTHROW void txqueue_push_tx ( struct txqueue self,
struct txqueue_entry entry 
)
Parameters
selfThe transactional queue.
entryThe queue entry to insert.

◆ txqueue_size_tx()

PICOTM_NOTHROW size_t txqueue_size_tx ( struct txqueue self)
Parameters
selfThe transactional queue.
Returns
The number of entries in the transactional queue.