@@ -168,112 +168,105 @@ extension DispatchSource : DispatchSourceProcess,
168
168
#endif
169
169
170
170
public protocol DispatchSourceType {
171
- #if false // crashes the swift compiler
172
- typealias DispatchSourceHandler = @convention ( block) ( ) -> Void
171
+ #if false /* FIXME: crashes the swift compiler */
172
+ typealias DispatchSourceHandler = @convention ( block) ( ) -> Void
173
173
174
- func setEventHandler( handler: DispatchSourceHandler ? )
174
+ func setEventHandler( handler: DispatchSourceHandler ? )
175
175
176
- func setCancelHandler( handler: DispatchSourceHandler ? )
176
+ func setCancelHandler( handler: DispatchSourceHandler ? )
177
177
178
- func setRegistrationHandler( handler: DispatchSourceHandler ? )
178
+ func setRegistrationHandler( handler: DispatchSourceHandler ? )
179
179
#endif
180
- func cancel( )
180
+ func cancel( )
181
181
182
- func resume( )
182
+ func resume( )
183
183
184
- func suspend( )
184
+ func suspend( )
185
185
186
- var handle : UInt { get }
186
+ var handle : UInt { get }
187
187
188
- var mask : UInt { get }
188
+ var mask : UInt { get }
189
189
190
- var data : UInt { get }
190
+ var data : UInt { get }
191
191
192
- var isCancelled : Bool { get }
192
+ var isCancelled : Bool { get }
193
193
}
194
194
195
195
public protocol DispatchSourceUserDataAdd : DispatchSourceType {
196
- func mergeData( value: UInt )
196
+ func mergeData( value: UInt )
197
197
}
198
198
199
199
public protocol DispatchSourceUserDataOr {
200
200
#if false /*FIXME: clashes with UserDataAdd?? */
201
- func mergeData( value: UInt )
201
+ func mergeData( value: UInt )
202
202
#endif
203
203
}
204
204
205
205
#if HAVE_MACH
206
206
public protocol DispatchSourceMachSend : DispatchSourceType {
207
+ public var handle : mach_port_t { get }
207
208
208
- public var handle : mach_port_t { get }
209
-
210
- public var data : DispatchSource . MachSendEvent { get }
211
-
212
- public var mask : DispatchSource . MachSendEvent { get }
209
+ public var data : DispatchSource . MachSendEvent { get }
213
210
211
+ public var mask : DispatchSource . MachSendEvent { get }
214
212
}
215
213
#endif
216
214
217
215
#if HAVE_MACH
218
216
public protocol DispatchSourceMachReceive : DispatchSourceType {
219
- var handle : mach_port_t { get }
217
+ var handle : mach_port_t { get }
220
218
}
221
219
#endif
222
220
223
221
#if HAVE_MACH
224
222
public protocol DispatchSourceMemoryPressure : DispatchSourceType {
223
+ public var data : DispatchSource . MemoryPressureEvent { get }
225
224
226
- public var data : DispatchSource . MemoryPressureEvent { get }
227
-
228
- public var mask : DispatchSource . MemoryPressureEvent { get }
229
-
225
+ public var mask : DispatchSource . MemoryPressureEvent { get }
230
226
}
231
227
#endif
232
228
233
229
#if !os(Linux)
234
230
public protocol DispatchSourceProcess : DispatchSourceType {
235
- var handle : pid_t { get }
231
+ var handle : pid_t { get }
236
232
237
- var data : DispatchSource . ProcessEvent { get }
233
+ var data : DispatchSource . ProcessEvent { get }
238
234
239
- var mask : DispatchSource . ProcessEvent { get }
235
+ var mask : DispatchSource . ProcessEvent { get }
240
236
}
241
237
#endif
242
238
243
239
public protocol DispatchSourceRead : DispatchSourceType {
244
-
245
240
}
246
241
247
242
public protocol DispatchSourceSignal : DispatchSourceType {
248
-
249
243
}
250
244
251
245
public protocol DispatchSourceTimer : DispatchSourceType {
252
- func setTimer( start: DispatchTime , leeway: DispatchTimeInterval )
246
+ func setTimer( start: DispatchTime , leeway: DispatchTimeInterval )
253
247
254
- func setTimer( walltime start: DispatchWallTime , leeway: DispatchTimeInterval )
248
+ func setTimer( walltime start: DispatchWallTime , leeway: DispatchTimeInterval )
255
249
256
- func setTimer( start: DispatchTime , interval: DispatchTimeInterval , leeway: DispatchTimeInterval )
250
+ func setTimer( start: DispatchTime , interval: DispatchTimeInterval , leeway: DispatchTimeInterval )
257
251
258
- func setTimer( start: DispatchTime , interval: Double , leeway: DispatchTimeInterval )
252
+ func setTimer( start: DispatchTime , interval: Double , leeway: DispatchTimeInterval )
259
253
260
- func setTimer( walltime start: DispatchWallTime , interval: DispatchTimeInterval , leeway: DispatchTimeInterval )
254
+ func setTimer( walltime start: DispatchWallTime , interval: DispatchTimeInterval , leeway: DispatchTimeInterval )
261
255
262
- func setTimer( walltime start: DispatchWallTime , interval: Double , leeway: DispatchTimeInterval )
256
+ func setTimer( walltime start: DispatchWallTime , interval: Double , leeway: DispatchTimeInterval )
263
257
}
264
258
265
259
#if !os(Linux)
266
260
public protocol DispatchSourceFileSystemObject : DispatchSourceType {
267
- var handle : Int32 { get }
261
+ var handle : Int32 { get }
268
262
269
- var data : DispatchSource . FileSystemEvent { get }
263
+ var data : DispatchSource . FileSystemEvent { get }
270
264
271
- var mask : DispatchSource . FileSystemEvent { get }
265
+ var mask : DispatchSource . FileSystemEvent { get }
272
266
}
273
267
#endif
274
268
275
269
public protocol DispatchSourceWrite : DispatchSourceType {
276
-
277
270
}
278
271
279
272
0 commit comments