|
Sunshine master
Self-hosted game stream host for Moonlight.
|
Declarations for thread-safe data structures. More...
#include <array>#include <atomic>#include <condition_variable>#include <functional>#include <map>#include <mutex>#include <vector>#include "utility.h"Go to the source code of this file.
Classes | |
| class | safe::alarm_raw_t< T > |
| Alarm primitive used to wait for and raise shutdown-style signals. More... | |
| class | safe::event_t< T > |
| Thread-safe event value that blocks readers until a value is raised. More... | |
| class | safe::mail_raw_t |
| Mailbox backing store for events, queues, and posted cleanup objects. More... | |
| class | safe::post_t< T > |
| Wrapper that posts cleanup work to a mailbox when destroyed. More... | |
| struct | safe::shared_t< T >::ptr_t |
| Pointer wrapper state protected by synchronization. More... | |
| class | safe::queue_t< T > |
| Thread-safe queue with blocking and shutdown-aware consumers. More... | |
| class | safe::shared_t< T > |
| Shared object storage with custom construction and destruction hooks. More... | |
Typedefs | |
| template<class T > | |
| using | safe::alarm_t = std::shared_ptr<alarm_raw_t<T>> |
| Shared alarm primitive used for cross-thread shutdown signals. | |
| using | safe::mail_t = std::shared_ptr<mail_raw_t> |
| Shared mailbox handle used by event and queue wrappers. | |
| using | safe::signal_t = event_t<bool> |
| Boolean alarm used as a simple signal. | |
Functions | |
| void | safe::cleanup (mail_raw_t *) |
| Run cleanup for completed asynchronous work. | |
| template<class T > | |
| auto | safe::lock (const std::weak_ptr< void > &wp) |
| Acquire the underlying lock or keyed mutex. | |
| template<class T > | |
| alarm_t< T > | safe::make_alarm () |
| Create a alarm object or message. | |
| template<class T , class F_Construct , class F_Destruct > | |
| auto | safe::make_shared (F_Construct &&fc, F_Destruct &&fd) |
| Create a shared object or message. | |
Declarations for thread-safe data structures.
|
inline |
Run cleanup for completed asynchronous work.
| Mailbox used to exchange messages with worker threads. |
|
inline |
Acquire the underlying lock or keyed mutex.
| wp | Weak pointer used to test whether the object is still alive. |
| alarm_t< T > safe::make_alarm | ( | ) |
Create a alarm object or message.
| auto safe::make_shared | ( | F_Construct && | fc, |
| F_Destruct && | fd ) |
Create a shared object or message.
| fc | Callable executed while the shared object is locked. |
| fd | Native file descriptor to wrap or inspect. |