File tree Expand file tree Collapse file tree 1 file changed +30
-3
lines changed
Expand file tree Collapse file tree 1 file changed +30
-3
lines changed Original file line number Diff line number Diff line change @@ -34,9 +34,36 @@ public struct AsyncDefaults {
3434/// or slow down poll interval. Default timeout interval is 1, and poll interval is 0.01.
3535///
3636/// - Note: This used to be known as ``AsyncDefaults``.
37- public struct PollingDefaults {
38- public static var timeout : NimbleTimeInterval = . seconds( 1 )
39- public static var pollInterval : NimbleTimeInterval = . milliseconds( 10 )
37+ public struct PollingDefaults : @unchecked Sendable {
38+ private static let lock = NSRecursiveLock ( )
39+
40+ private static var _timeout : NimbleTimeInterval = . seconds( 1 )
41+ private static var _pollInterval : NimbleTimeInterval = . milliseconds( 10 )
42+
43+ public static var timeout : NimbleTimeInterval {
44+ get {
45+ lock. lock ( )
46+ defer { lock. unlock ( ) }
47+ return _timeout
48+ }
49+ set {
50+ lock. lock ( )
51+ defer { lock. unlock ( ) }
52+ _timeout = newValue
53+ }
54+ }
55+ public static var pollInterval : NimbleTimeInterval {
56+ get {
57+ lock. lock ( )
58+ defer { lock. unlock ( ) }
59+ return _pollInterval
60+ }
61+ set {
62+ lock. lock ( )
63+ defer { lock. unlock ( ) }
64+ _pollInterval = newValue
65+ }
66+ }
4067}
4168
4269internal enum AsyncMatchStyle {
You can’t perform that action at this time.
0 commit comments