Structs
The following structs are available globally.
-
Provides a type-safe mechanism for accessing thread-local values (of type
T) stored in thethreadDictionaryassociated with the calling thread.As the class name implies, values set using
See moreThreadLocalValueare only visible to the thread that set those values.Declaration
Swift
public struct ThreadLocalValue<T: Any>
-
CriticalSections can be used to ensure exclusive access to a given resource.By protecting a resource with a
CriticalSection, you ensure that only one one thread can be executing code using that critical section at any given time.
See moreCriticalSections are re-entrant, meaning that code already holding access to the critical section may re-enter the critical section without causing a deadlock. (TheNSRecursiveLockclass is used under the hood.)Declaration
Swift
public struct CriticalSection
View on GitHub
Structs Reference