The Pedigree Project 0.1
Classes | Public Types | Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
RcuRetireQueue Class Reference

#include <Rcu.h>

+ Collaboration diagram for RcuRetireQueue:

Classes

struct  Entry
 

Public Types

using Reclaim = void(*)(void *)
 

Public Member Functions

void retire (void *object, Reclaim reclaim)
 
void drain ()
 

Static Public Attributes

static constexpr size_t Capacity = 32
 

Private Member Functions

 NOT_COPYABLE_OR_ASSIGNABLE (RcuRetireQueue)
 
void drainLocked ()
 

Private Attributes

Mutex m_Lock
 
struct RcuRetireQueue::Entry m_Entries [Capacity]
 
size_t m_Count = 0
 

Detailed Description

Bounded deferred reclamation for a writer-owned lifetime domain.

A full queue applies synchronous backpressure. Call drain() before releasing callback code or its owner (in particular before module unload); destruction also drains. Callbacks reclaim storage in task context and must not invoke queue operations. Do not enqueue while holding locks needed by a callback.

Definition at line 69 of file Rcu.h.

Member Typedef Documentation

◆ Reclaim

using RcuRetireQueue::Reclaim = void (*)(void*)

Definition at line 72 of file Rcu.h.

Constructor & Destructor Documentation

◆ ~RcuRetireQueue()

RcuRetireQueue::~RcuRetireQueue ( )

Definition at line 45 of file Rcu.cc.

Member Function Documentation

◆ drain()

void RcuRetireQueue::drain ( )

Definition at line 63 of file Rcu.cc.

◆ drainLocked()

void RcuRetireQueue::drainLocked ( )
private

Definition at line 73 of file Rcu.cc.

◆ retire()

void RcuRetireQueue::retire ( void *  object,
Reclaim  reclaim 
)

Definition at line 49 of file Rcu.cc.

Member Data Documentation

◆ Capacity

constexpr size_t RcuRetireQueue::Capacity = 32
staticconstexpr

Definition at line 71 of file Rcu.h.

◆ m_Count

size_t RcuRetireQueue::m_Count = 0
private

Definition at line 87 of file Rcu.h.

◆ m_Lock

Mutex RcuRetireQueue::m_Lock
private

Definition at line 82 of file Rcu.h.


The documentation for this class was generated from the following files: