|
Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
|
RAII class for managing the lifetime of an atomic bool. More...
#include <src/utils/concurrency.h>
Public Member Functions | |
| AtomicBoolRAII (std::atomic< bool > &flag) | |
| AtomicBoolRAII (const AtomicBoolRAII &)=delete | |
| AtomicBoolRAII & | operator= (const AtomicBoolRAII &)=delete |
| AtomicBoolRAII (AtomicBoolRAII &&)=delete | |
| AtomicBoolRAII & | operator= (AtomicBoolRAII &&)=delete |
RAII class for managing the lifetime of an atomic bool.
This class provides a convenient and safe way to manage the lifetime of an atomic bool using the RAII (Resource Acquisition Is Initialization) idiom. When an instance of AtomicBoolRAII is created, it sets the associated atomic bool to true. When the instance goes out of scope, the destructor sets the atomic bool back to false.
Usage example:
Definition at line 33 of file concurrency.h.
|
inlineexplicit |
Definition at line 39 of file concurrency.h.
|
inline |
Definition at line 44 of file concurrency.h.