Syntalos::Guarded

Syntalos::Guarded

Syntalos::Guarded

A mutex-protected value that is handed over between the main thread and a worker. More…

#include <moduleworker.h>

Public Functions

Name
Guarded()
Guarded(T initialValue)
voidset(T value)
Ttake()
Move the value out (leaves a default-constructed one behind).

Detailed Description

template <typename T >
class Syntalos::Guarded;

A mutex-protected value that is handed over between the main thread and a worker.

This is a handle: copies share the same value. One side deposits a value with set(), the other one moves it out with take().

Public Functions Documentation

function Guarded

inline Guarded()

function Guarded

inline Guarded(
    T initialValue
)

function set

inline void set(
    T value
)

function take

inline T take()

Move the value out (leaves a default-constructed one behind).


Updated on 2026-11-26 at 18:54:14 +0000