Skip to content

File SolidSyslogStdAtomicCounter.h

FileList > Atomics > Interface > SolidSyslogStdAtomicCounter.h

Go to the source code of this file

An AtomicCounter over C11 <stdatomic.h>, backing the RFC 5424 sequenceId. More...

  • #include "ExternC.h"

Public Functions

Type Name
struct SolidSyslogAtomicCounter * SolidSyslogStdAtomicCounter_Create (void)
Create takes no config; an exhausted pool falls back to the shared NullAtomicCounter, whose Increment returns 1 unconditionally.
void SolidSyslogStdAtomicCounter_Destroy (struct SolidSyslogAtomicCounter * base)
Release the pool slot; the counter's state is discarded.

Detailed Description

Increment runs an atomic_compare_exchange_strong_explicit CAS loop on an _Atomic uint32_t; the sequence is wrap-aware in [1, 2^31 - 1] and skips zero on wrap, so a returned value is never 0.

Public Functions Documentation

function SolidSyslogStdAtomicCounter_Create

Create takes no config; an exhausted pool falls back to the shared NullAtomicCounter, whose Increment returns 1 unconditionally.

struct SolidSyslogAtomicCounter * SolidSyslogStdAtomicCounter_Create (
    void
) 


function SolidSyslogStdAtomicCounter_Destroy

Release the pool slot; the counter's state is discarded.

void SolidSyslogStdAtomicCounter_Destroy (
    struct SolidSyslogAtomicCounter * base
) 



The documentation for this class was generated from the following file Platform/Atomics/Interface/SolidSyslogStdAtomicCounter.h