An alternative flag that can be used with call_once that uses only 1 byte. Uses a 3‐state std::atomic<uint8_t> with wait/notify for synchronization.
Synopsis
Declared in <folly/synchronization/CallOnce.h>
class compact_once_flag;
Member Functions
Name |
Description |
|
Constructors |
|
Deleted copy assignment; once‐flags are not copyable. |
Friends
Name |
Description |
Like call_once, but using a boolean return type to signal pass/fail rather than throwing exceptions. |
|
Sets a flag, as if call_once(flag, []{}) was called. |
|
Resets a flag. |
|
Tests whether any invocation to call_once with the given flag has succeeded. |
|
Drop‐in replacement for std::call_once. |
Created with MrDocs