Implementation details.
Types
Name |
Description |
POD wrapper around an element (a void*) and an associated deleter. This must be POD, as we memset() it to 0 and memcpy() it around. |
|
No‐op stand‐in for UniqueInstance used when the tag is void. |
|
Deleter that owns a shared_ptr and disposes it on thread‐local destruction. |
|
Held in a singleton to track our global instances. We have one of these per "Tag", by default one for the whole system (Tag=void). |
|
Non‐templated base holding the shared thread‐local bookkeeping state. |
|
Per‐thread entry. Each thread using a StaticMeta object has one. This is written from the owning thread only (under the lock), read from the owning thread (no lock necessary), and read from other threads (under the lock). |
|
Intrusive list of ThreadEntry objects for a single thread. |
|
ThreadEntrySet is used to track all ThreadEntry that have a valid ElementWrapper for a particular TL id. The class provides no internal locking and caller must ensure safety of any access. |
Type Aliases
Name |
Description |
Cache the ptr + deleter info in ThreadEntrySet too. This allows accessAllThreads() to get to the per thread ptr without holding the StaticMeta's lock_. Eventually, the deleter info will be moved to the ThreadEntrySet alone, leaving only the ptr in the ElementWrapper. For now, the ElementDisposeInfo tracked in ThreadEntrySet is the same as ElementWrapper. |
Variables
Name |
Description |
Sentinel entry id representing an unallocated thread‐local slot. |
Created with MrDocs