@frozen
public struct ThreadSafeReference<Confined> where Confined : ThreadConfined
extension ThreadSafeReference: Sendable
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 Realm.resolve(_:)
.
Warning
A 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.
Note
Prefer short-lived ThreadSafeReference
s 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.
DeclarationSwift
public var isInvalidated: Bool { get }
Create a thread-safe reference to the thread-confined object.
Note
You may continue to use and access the thread-confined object after passing it to this constructor.
DeclarationSwift
public init(to threadConfined: Confined)
Parameters threadConfined
The thread-confined object to create a thread-safe reference to.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4