public class ThreadSafeReference<Confined: ThreadConfined>
An object intended to be passed between threads containing a thread-safe reference to its thread-confined object.
To resolve a thread-safe reference on a target Realm on a different thread, pass to
ThreadSafeReference object must be resolved at most once.
Failing to resolve a
ThreadSafeReference will result in the source version of the
Realm being pinned until the reference is deallocated.
ThreadSafeReferences as the data for the version of the source Realm
will be retained until all references have been resolved or deallocated.
Indicates if the reference can no longer be resolved because an attempt to resolve it has already occurred. References can only be resolved once.
public var isInvalidated: Bool
Create a thread-safe reference to the thread-confined object.
You may continue to use and access the thread-confined object after passing it to this constructor.
public init(to threadConfined: Confined)
The thread-confined object to create a thread-safe reference to.