@@ -59,11 +59,6 @@ public struct DispatchQoS : Equatable {
5959 @available ( OSX 10 . 10 , iOS 8 . 0 , * )
6060 public static let `default` = DispatchQoS ( qosClass: . default, relativePriority: 0 )
6161
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-
6762 @available ( OSX 10 . 10 , iOS 8 . 0 , * )
6863 public static let userInitiated = DispatchQoS ( qosClass: . userInitiated, relativePriority: 0 )
6964
@@ -82,11 +77,6 @@ public struct DispatchQoS : Equatable {
8277 @available ( OSX 10 . 10 , iOS 8 . 0 , * )
8378 case `default`
8479
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-
9080 @available ( OSX 10 . 10 , iOS 8 . 0 , * )
9181 case userInitiated
9282
@@ -95,9 +85,11 @@ public struct DispatchQoS : Equatable {
9585
9686 case unspecified
9787
88+ // _OSQoSClass is internal on Linux, so this initialiser has to
89+ // remain as an internal init.
9890 @available ( OSX 10 . 10 , iOS 8 . 0 , * )
99- internal init ? ( qosClass : _OSQoSClass ) {
100- switch qosClass {
91+ internal init ? ( rawValue : _OSQoSClass ) {
92+ switch rawValue {
10193 case . QOS_CLASS_BACKGROUND: self = . background
10294 case . QOS_CLASS_UTILITY: self = . utility
10395 case . QOS_CLASS_DEFAULT: self = . default
@@ -135,8 +127,8 @@ public func ==(a: DispatchQoS, b: DispatchQoS) -> Bool {
135127
136128public enum DispatchTimeoutResult {
137129 static let KERN_OPERATION_TIMED_OUT : Int = 49
138- case Success
139- case TimedOut
130+ case success
131+ case timedOut
140132}
141133
142134/// dispatch_group
@@ -161,21 +153,11 @@ public extension DispatchGroup {
161153 }
162154
163155 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
165157 }
166158
167159 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
179161 }
180162}
181163
@@ -192,20 +174,10 @@ public extension DispatchSemaphore {
192174 }
193175
194176 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
196178 }
197179
198180 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
210182 }
211183}
0 commit comments