Structs

The following structs are available globally.

  • Provides a type-safe mechanism for accessing thread-local values (of type T) stored in the threadDictionary associated with the calling thread.

    As the class name implies, values set using ThreadLocalValue are only visible to the thread that set those values.

    See more

    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.

    CriticalSections are re-entrant, meaning that code already holding access to the critical section may re-enter the critical section without causing a deadlock. (The NSRecursiveLock class is used under the hood.)

    See more

    Declaration

    Swift

    public struct CriticalSection