Private helpers. More...
Classes | |
| class | Owner |
| Opaque unique state and creator-module lifetime callbacks. More... | |
| struct | Control |
| Base-owned reference counts and the real destructor. More... | |
| struct | IsVoidFunction |
Whether T is a void-returning Function. More... | |
| struct | IsVoidFunction< Function< void(Args...)> > |
| A void-returning Function. More... | |
| struct | ThreadState |
| Decayed callable and arguments, allocated on Base's heap. More... | |
| struct | FunctionState |
| Function and its arguments, allocated on Base's heap. More... | |
Concepts | |
| concept | SafeCallbackArgument |
| Callback arguments admitted across a DLL boundary. | |
| concept | SafeOptionalResult |
| Recognizes a monadic result that can report an empty state. | |
Functions | |
| void * | WordCreate (std::size_t bytes) |
| Allocate a zeroed word on Base's heap. | |
| void | WordDestroy (void *word) noexcept |
| Destroy a word from WordCreate. | |
| void | WordLoad (void *word, std::size_t bytes, void *out, MemoryOrder order) noexcept |
Load the low bytes of a word. | |
| void | WordStore (void *word, std::size_t bytes, const void *value, MemoryOrder order) noexcept |
Store bytes into the low part of a word. | |
| void | WordExchange (void *word, std::size_t bytes, const void *desired, void *previous, MemoryOrder order) noexcept |
| Replace the value and return the previous one. | |
| bool | WordCompareExchange (void *word, std::size_t bytes, void *expected, const void *desired, MemoryOrder success, MemoryOrder failure, bool weak) noexcept |
Compare-exchange the low bytes. | |
| void | WordFetchOp (void *word, std::size_t bytes, std::int64_t delta, void *previous, MemoryOrder order, int op) noexcept |
Integer operation on the low bytes. | |
| void | WordWait (void *word, std::size_t bytes, const void *old, MemoryOrder order) noexcept |
Wait while the low bytes still equal old. | |
| void | WordNotifyOne (void *word) noexcept |
Wake one waiter on word. | |
| void | WordNotifyAll (void *word) noexcept |
Wake every waiter on word. | |
| bool | WordLockFree (void *word) noexcept |
| Whether Base's word is lock-free. | |
| void | ThrowSafeConversionFailure (const char *message) |
| Throw Base's exception for a failed Safe conversion. | |
| void * | ThreadStart (void(*entry)(void *), void *argument) |
| Start a thread whose body lives in Base. | |
| void | ThreadDestroy (void *thread) noexcept |
| Destroy a thread from ThreadStart. | |
| bool | ThreadJoinable (void *thread) noexcept |
| Whether the thread still owns an execution. | |
| void | ThreadJoin (void *thread) |
| Wait until the execution returns. | |
| void | ThreadDetach (void *thread) |
| Detach the execution. | |
| std::uint64_t | ThreadId (void *thread) noexcept |
| Identifier of the owned execution. | |
| std::uintptr_t | ThreadNative (void *thread) noexcept |
| Native handle as an integer. | |
| std::uint64_t | ThreadSelf () noexcept |
| Identifier of the calling execution. | |
| unsigned | ThreadHardware () noexcept |
| Hint of concurrent executions. | |
| void | ThreadYield () noexcept |
| Offer the calling execution. | |
| void | ThreadSleep (std::uint64_t nanoseconds) noexcept |
| Sleep the calling execution. | |
Private helpers.
Control block shared by Shared and Weak.
Private implementation helpers for Safe containers.
Private implementation helpers for Safe callbacks.
Not a supported API.
|
noexcept |
Destroy a thread from ThreadStart.
| thread | Thread address. A joinable thread terminates the process. Null is ignored. |
| void StormByte::Safe::Detail::ThreadDetach | ( | void * | thread | ) |
|
noexcept |
Hint of concurrent executions.
|
noexcept |
Identifier of the owned execution.
| thread | Thread address. Not null. |
| void StormByte::Safe::Detail::ThreadJoin | ( | void * | thread | ) |
|
noexcept |
Whether the thread still owns an execution.
| thread | Thread address. Not null. |
|
noexcept |
Native handle as an integer.
Not a CRT thread type.
| thread | Thread address. Not null. |
|
noexcept |
Identifier of the calling execution.
|
noexcept |
Sleep the calling execution.
| nanoseconds | Duration. Zero returns immediately. |
| void * StormByte::Safe::Detail::ThreadStart | ( | void(* | entry )(void *), |
| void * | argument ) |
Start a thread whose body lives in Base.
| entry | Entry. Not null. Base calls it and then returns. |
| argument | Argument passed to entry. May be null. |
| AllocationError | The thread cannot be started. |
|
noexcept |
Offer the calling execution.
| void StormByte::Safe::Detail::ThrowSafeConversionFailure | ( | const char * | message | ) |
Throw Base's exception for a failed Safe conversion.
| message | Failure description. |
|
noexcept |
Compare-exchange the low bytes.
| word | Word address. |
| bytes | Value width. |
| expected | Expected value. Replaced with the actual value on failure. |
| desired | Value to store on success. |
| success | Order on success. |
| failure | Order on failure. Release and acq-rel are promoted to acquire. |
| weak | Whether a spurious failure is allowed. |
| void * StormByte::Safe::Detail::WordCreate | ( | std::size_t | bytes | ) |
Allocate a zeroed word on Base's heap.
| bytes | Width of the value. One, two, four or eight. |
| AllocationError | The word cannot be allocated. |
|
noexcept |
Destroy a word from WordCreate.
| word | Word address. Null is ignored. |
|
noexcept |
Replace the value and return the previous one.
| word | Word address. |
| bytes | Value width. |
| desired | New value, bytes long. |
| previous | Destination of the previous value. |
| order | Order. |
|
noexcept |
Integer operation on the low bytes.
| word | Word address. |
| bytes | Value width. |
| delta | Operand, already scaled for a pointer. |
| previous | Destination of the previous value. |
| order | Order. |
| op | Zero add, one subtract, two and, three or, four xor. |
|
noexcept |
Load the low bytes of a word.
| word | Word address. |
| bytes | Value width. |
| out | Destination of bytes. Not null. |
| order | Load order. |
|
noexcept |
Whether Base's word is lock-free.
| word | Word address. |
|
noexcept |
Wake every waiter on word.
| word | Word address. |
|
noexcept |
Wake one waiter on word.
| word | Word address. |
|
noexcept |
Store bytes into the low part of a word.
| word | Word address. |
| bytes | Value width. |
| value | Source of bytes. Not null. |
| order | Store order. |
|
noexcept |
Wait while the low bytes still equal old.
| word | Word address. |
| bytes | Value width. |
| old | Captured value. |
| order | Load order used by the wait. |