File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Sources/FoundationEssentials/NotificationCenter Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,8 @@ extension NotificationCenter {
2222
2323#if !FOUNDATION_FRAMEWORK
2424
25+ internal import Synchronization
26+
2527// Dictionary storage with automatic key generation
2628private struct AutoDictionary < Value> {
2729 private var storage : [ UInt64 : Value ] = [ : ]
@@ -75,11 +77,11 @@ private struct MessageBox {
7577}
7678
7779open class NotificationCenter : @unchecked Sendable {
78- private var registrar : LockedState < [ String ? /* Notification name */: [ ObjectIdentifier ? /* object */ : AutoDictionary < @Sendable ( MessageBox ) -> Void > ] ] >
80+ private let registrar : Mutex < [ String ? /* Notification name */: [ ObjectIdentifier ? /* object */ : AutoDictionary < @Sendable ( MessageBox ) -> Void > ] ] >
7981 internal lazy var _actorQueueManager = _NotificationCenterActorQueueManager ( )
8082
8183 public required init ( ) {
82- registrar = LockedState ( initialState : [ : ] )
84+ registrar = . init ( [ : ] )
8385 }
8486
8587 open class var `default` : NotificationCenter {
You can’t perform that action at this time.
0 commit comments