From 590961fb2c8ac40957fbc20205b05738e0be7efd Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Sun, 7 Jul 2019 14:01:44 -0700 Subject: [PATCH] =?UTF-8?q?Add=20comment=20that=20Account=20is=20main-thre?= =?UTF-8?q?ad-only,=20and=20assert=20that=20we=E2=80=99re=20on=20the=20mai?= =?UTF-8?q?n=20thread=20in=20flattenedFeeds().?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Frameworks/Account/Account.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Frameworks/Account/Account.swift b/Frameworks/Account/Account.swift index dfa0ea452..80713ef82 100644 --- a/Frameworks/Account/Account.swift +++ b/Frameworks/Account/Account.swift @@ -17,6 +17,8 @@ import RSParser import ArticlesDatabase import RSWeb +// Main thread only. + public extension Notification.Name { static let AccountRefreshDidBegin = Notification.Name(rawValue: "AccountRefreshDidBegin") static let AccountRefreshDidFinish = Notification.Name(rawValue: "AccountRefreshDidFinish") @@ -636,6 +638,7 @@ public final class Account: DisplayNameProvider, UnreadCountProvider, Container, // MARK: - Container public func flattenedFeeds() -> Set { + assert(Thread.isMainThread) if flattenedFeedsNeedUpdate { updateFlattenedFeeds() }