Skip to content

Commit 7186496

Browse files
authored
Limit Synchronization usage to FOUNDATION_FRAMEWORK (#736)
1 parent df93071 commit 7186496

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Sources/FoundationEssentials/Locale/Locale_Notifications.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
#if canImport(Synchronization) && (!canImport(Darwin) || FOUNDATION_FRAMEWORK)
13+
#if canImport(Synchronization) && FOUNDATION_FRAMEWORK
1414
internal import Synchronization
1515
#endif
1616

@@ -20,14 +20,14 @@ internal import Synchronization
2020
struct LocaleNotifications : Sendable, ~Copyable {
2121
static let cache = LocaleNotifications()
2222

23-
#if canImport(Synchronization) && (!canImport(Darwin) || FOUNDATION_FRAMEWORK)
23+
#if canImport(Synchronization) && FOUNDATION_FRAMEWORK
2424
let _count = Atomic<Int>(1)
2525
#else
2626
let _count = LockedState<Int>(initialState: 1)
2727
#endif
2828

2929
func count() -> Int {
30-
#if canImport(Synchronization) && (!canImport(Darwin) || FOUNDATION_FRAMEWORK)
30+
#if canImport(Synchronization) && FOUNDATION_FRAMEWORK
3131
_count.load(ordering: .relaxed)
3232
#else
3333
_count.withLock { $0 }
@@ -39,7 +39,7 @@ struct LocaleNotifications : Sendable, ~Copyable {
3939
LocaleCache.cache.reset()
4040
CalendarCache.cache.reset()
4141
_ = TimeZoneCache.cache.reset()
42-
#if canImport(Synchronization) && (!canImport(Darwin) || FOUNDATION_FRAMEWORK)
42+
#if canImport(Synchronization) && FOUNDATION_FRAMEWORK
4343
_count.add(1, ordering: .relaxed)
4444
#else
4545
_count.withLock { $0 += 1 }

0 commit comments

Comments
 (0)