@@ -59,11 +59,6 @@ public struct DispatchQoS : Equatable {
59
59
@available ( OSX 10 . 10 , iOS 8 . 0 , * )
60
60
public static let `default` = DispatchQoS ( qosClass: . default, relativePriority: 0 )
61
61
62
- @available ( OSX, introduced: 10.10 , deprecated: 10.10 , renamed: " DispatchQoS.default " )
63
- @available ( iOS, introduced: 8.0 , deprecated: 8.0 , renamed: " DispatchQoS.default " )
64
- @available ( * , deprecated, renamed: " DispatchQoS.default " )
65
- public static let defaultQoS = DispatchQoS . default
66
-
67
62
@available ( OSX 10 . 10 , iOS 8 . 0 , * )
68
63
public static let userInitiated = DispatchQoS ( qosClass: . userInitiated, relativePriority: 0 )
69
64
@@ -82,11 +77,6 @@ public struct DispatchQoS : Equatable {
82
77
@available ( OSX 10 . 10 , iOS 8 . 0 , * )
83
78
case `default`
84
79
85
- @available ( OSX, introduced: 10.10 , deprecated: 10.10 , renamed: " QoSClass.default " )
86
- @available ( iOS, introduced: 8.0 , deprecated: 8.0 , renamed: " QoSClass.default " )
87
- @available ( * , deprecated, renamed: " QoSClass.default " )
88
- static let defaultQoS = QoSClass . default
89
-
90
80
@available ( OSX 10 . 10 , iOS 8 . 0 , * )
91
81
case userInitiated
92
82
@@ -95,9 +85,11 @@ public struct DispatchQoS : Equatable {
95
85
96
86
case unspecified
97
87
88
+ // _OSQoSClass is internal on Linux, so this initialiser has to
89
+ // remain as an internal init.
98
90
@available ( OSX 10 . 10 , iOS 8 . 0 , * )
99
- internal init ? ( qosClass : _OSQoSClass ) {
100
- switch qosClass {
91
+ internal init ? ( rawValue : _OSQoSClass ) {
92
+ switch rawValue {
101
93
case . QOS_CLASS_BACKGROUND: self = . background
102
94
case . QOS_CLASS_UTILITY: self = . utility
103
95
case . QOS_CLASS_DEFAULT: self = . default
@@ -135,8 +127,8 @@ public func ==(a: DispatchQoS, b: DispatchQoS) -> Bool {
135
127
136
128
public enum DispatchTimeoutResult {
137
129
static let KERN_OPERATION_TIMED_OUT : Int = 49
138
- case Success
139
- case TimedOut
130
+ case success
131
+ case timedOut
140
132
}
141
133
142
134
/// dispatch_group
@@ -161,21 +153,11 @@ public extension DispatchGroup {
161
153
}
162
154
163
155
public func wait( timeout: DispatchTime ) -> DispatchTimeoutResult {
164
- return dispatch_group_wait ( self . __wrapped, timeout. rawValue) == 0 ? . Success : . TimedOut
156
+ return dispatch_group_wait ( self . __wrapped, timeout. rawValue) == 0 ? . success : . timedOut
165
157
}
166
158
167
159
public func wait( wallTimeout timeout: DispatchWallTime ) -> DispatchTimeoutResult {
168
- return dispatch_group_wait ( self . __wrapped, timeout. rawValue) == 0 ? . Success : . TimedOut
169
- }
170
- }
171
-
172
- public extension DispatchGroup {
173
- @available ( * , deprecated, renamed: " DispatchGroup.wait(self:wallTimeout:) " )
174
- public func wait( walltime timeout: DispatchWallTime ) -> Int {
175
- switch wait ( wallTimeout: timeout) {
176
- case . Success: return 0
177
- case . TimedOut: return DispatchTimeoutResult . KERN_OPERATION_TIMED_OUT
178
- }
160
+ return dispatch_group_wait ( self . __wrapped, timeout. rawValue) == 0 ? . success : . timedOut
179
161
}
180
162
}
181
163
@@ -192,20 +174,10 @@ public extension DispatchSemaphore {
192
174
}
193
175
194
176
public func wait( timeout: DispatchTime ) -> DispatchTimeoutResult {
195
- return dispatch_semaphore_wait ( self . __wrapped, timeout. rawValue) == 0 ? . Success : . TimedOut
177
+ return dispatch_semaphore_wait ( self . __wrapped, timeout. rawValue) == 0 ? . success : . timedOut
196
178
}
197
179
198
180
public func wait( wallTimeout: DispatchWallTime ) -> DispatchTimeoutResult {
199
- return dispatch_semaphore_wait ( self . __wrapped, wallTimeout. rawValue) == 0 ? . Success : . TimedOut
200
- }
201
- }
202
-
203
- public extension DispatchSemaphore {
204
- @available ( * , deprecated, renamed: " DispatchSemaphore.wait(self:wallTimeout:) " )
205
- public func wait( walltime timeout: DispatchWalltime ) -> Int {
206
- switch wait ( wallTimeout: timeout) {
207
- case . Success: return 0
208
- case . TimedOut: return DispatchTimeoutResult . KERN_OPERATION_TIMED_OUT
209
- }
181
+ return dispatch_semaphore_wait ( self . __wrapped, wallTimeout. rawValue) == 0 ? . success : . timedOut
210
182
}
211
183
}
0 commit comments