Mark many things as MainActor and deal with the fallout.

This commit is contained in:
Brent Simmons
2024-03-25 21:10:37 -07:00
parent 87db1e3d5f
commit 27d27cbf1a
34 changed files with 693 additions and 625 deletions

View File

@@ -17,12 +17,12 @@ extension Notification.Name {
public protocol DisplayNameProvider {
var nameForDisplay: String { get }
@MainActor var nameForDisplay: String { get }
}
public extension DisplayNameProvider {
func postDisplayNameDidChangeNotification() {
@MainActor func postDisplayNameDidChangeNotification() {
NotificationCenter.default.post(name: .DisplayNameDidChange, object: self, userInfo: nil)
}

View File

@@ -39,7 +39,7 @@ public protocol MainThreadOperation: AnyObject {
///
/// The completionBlock is always called on the main thread.
/// The queue will clear the completionBlock after calling it.
var completionBlock: MainThreadOperationCompletionBlock? { get set }
@MainActor var completionBlock: MainThreadOperationCompletionBlock? { get set }
/// Do the thing this operation does.
///