@@ -39,7 +39,7 @@ extension TaskGroup {
3939 #if $BuiltinCreateAsyncTaskInGroupWithExecutor
4040 let flags = taskCreateFlags (
4141 priority: priority, isChildTask: true , copyTaskLocals: false ,
42- inheritContext: false , enqueueJob: false ,
42+ inheritContext: false , enqueueJob: true ,
4343 addPendingGroupTaskUnconditionally: true ,
4444 isDiscardingTask: false )
4545
@@ -50,17 +50,8 @@ extension TaskGroup {
5050 _getUndefinedTaskExecutor ( )
5151 }
5252
53- // if let taskExecutor {
54- // let executorBuiltin: Builtin.Executor =
55- // taskExecutor.asUnownedTaskExecutor().executor
56- //
57- // Create the task in this group with an executor preference.
53+ // Create the task in this group with an executor preference.
5854 _ = Builtin . createAsyncTaskInGroupWithExecutor ( flags, _group, executorBuiltin, operation)
59- // } else {
60- // // FIXME: DISABLE THE TASK PREFERENCE (PASS NIL?)
61- // // Create the task in this group without executor preference.
62- // fatalError("NOT YET") // _ = Builtin.createAsyncTaskInGroup(flags, _group, operation)
63- // }
6455 #else
6556 fatalError ( " Unsupported Swift compiler " )
6657 #endif
@@ -95,22 +86,19 @@ extension TaskGroup {
9586 }
9687 let flags = taskCreateFlags (
9788 priority: priority, isChildTask: true , copyTaskLocals: false ,
98- inheritContext: false , enqueueJob: false ,
89+ inheritContext: false , enqueueJob: true ,
9990 addPendingGroupTaskUnconditionally: false ,
10091 isDiscardingTask: false )
10192
102- if let taskExecutor {
103- let executorBuiltin : Builtin . Executor =
93+ let executorBuiltin : Builtin . Executor =
94+ if let taskExecutor {
10495 taskExecutor. asUnownedTaskExecutor ( ) . executor
96+ } else {
97+ _getUndefinedTaskExecutor ( )
98+ }
10599
106- // Create the task in this group with an executor preference.
107- _ = Builtin . createAsyncTaskInGroupWithExecutor ( flags, _group, executorBuiltin, operation)
108- } else {
109- // FIXME: DISABLE THE TASK PREFERENCE (PASS NIL?)
110- // Create the task in this group without executor preference.
111- fatalError ( " NOT YET " ) // _ = Builtin.createAsyncTaskInGroup(flags, _group, operation)
112- }
113-
100+ // Create the task in this group with an executor preference.
101+ _ = Builtin . createAsyncTaskInGroupWithExecutor ( flags, _group, executorBuiltin, operation)
114102 return true
115103 #else
116104 fatalError ( " Unsupported Swift compiler " )
@@ -143,21 +131,19 @@ extension ThrowingTaskGroup {
143131 #if $BuiltinCreateAsyncTaskInGroupWithExecutor
144132 let flags = taskCreateFlags (
145133 priority: priority, isChildTask: true , copyTaskLocals: false ,
146- inheritContext: false , enqueueJob: false ,
134+ inheritContext: false , enqueueJob: true ,
147135 addPendingGroupTaskUnconditionally: true ,
148136 isDiscardingTask: false )
149137
150- if let taskExecutor {
151- let executorBuiltin : Builtin . Executor =
138+ let executorBuiltin : Builtin . Executor =
139+ if let taskExecutor {
152140 taskExecutor. asUnownedTaskExecutor ( ) . executor
141+ } else {
142+ _getUndefinedTaskExecutor ( )
143+ }
153144
154- // Create the task in this group with an executor preference.
155- _ = Builtin . createAsyncTaskInGroupWithExecutor ( flags, _group, executorBuiltin, operation)
156- } else {
157- // FIXME: DISABLE THE TASK PREFERENCE (PASS NIL?)
158- // Create the task in this group without executor preference.
159- fatalError ( " NOT YET " ) // _ = Builtin.createAsyncTaskInGroup(flags, _group, operation)
160- }
145+ // Create the task in this group with an executor preference.
146+ _ = Builtin . createAsyncTaskInGroupWithExecutor ( flags, _group, executorBuiltin, operation)
161147 #else
162148 fatalError ( " Unsupported Swift compiler " )
163149 #endif
@@ -192,22 +178,19 @@ extension ThrowingTaskGroup {
192178 }
193179 let flags = taskCreateFlags (
194180 priority: priority, isChildTask: true , copyTaskLocals: false ,
195- inheritContext: false , enqueueJob: false ,
181+ inheritContext: false , enqueueJob: true ,
196182 addPendingGroupTaskUnconditionally: false ,
197183 isDiscardingTask: false )
198184
199- if let taskExecutor {
200- let executorBuiltin : Builtin . Executor =
185+ let executorBuiltin : Builtin . Executor =
186+ if let taskExecutor {
201187 taskExecutor. asUnownedTaskExecutor ( ) . executor
188+ } else {
189+ _getUndefinedTaskExecutor ( )
190+ }
202191
203- // Create the task in this group with an executor preference.
204- _ = Builtin . createAsyncTaskInGroupWithExecutor ( flags, _group, executorBuiltin, operation)
205- } else {
206- // FIXME: DISABLE THE TASK PREFERENCE (PASS NIL?)
207- // Create the task in this group without executor preference.
208- fatalError ( " NOT YET " ) // _ = Builtin.createAsyncTaskInGroup(flags, _group, operation)
209- }
210-
192+ // Create the task in this group with an executor preference.
193+ _ = Builtin . createAsyncTaskInGroupWithExecutor ( flags, _group, executorBuiltin, operation)
211194 return true
212195 #else
213196 fatalError ( " Unsupported Swift compiler " )
@@ -240,21 +223,19 @@ extension DiscardingTaskGroup {
240223 #if $BuiltinCreateAsyncTaskInGroupWithExecutor
241224 let flags = taskCreateFlags (
242225 priority: priority, isChildTask: true , copyTaskLocals: false ,
243- inheritContext: false , enqueueJob: false ,
226+ inheritContext: false , enqueueJob: true ,
244227 addPendingGroupTaskUnconditionally: true ,
245228 isDiscardingTask: true )
246229
247- if let taskExecutor {
248- let executorBuiltin : Builtin . Executor =
230+ let executorBuiltin : Builtin . Executor =
231+ if let taskExecutor {
249232 taskExecutor. asUnownedTaskExecutor ( ) . executor
233+ } else {
234+ _getUndefinedTaskExecutor ( )
235+ }
250236
251- // Create the task in this group with an executor preference.
252- _ = Builtin . createAsyncTaskInGroupWithExecutor ( flags, _group, executorBuiltin, operation)
253- } else {
254- // FIXME: DISABLE THE TASK PREFERENCE (PASS NIL?)
255- // Create the task in this group without executor preference.
256- fatalError ( " NOT YET " ) // _ = Builtin.createAsyncTaskInGroup(flags, _group, operation)
257- }
237+ // Create the task in this group with an executor preference.
238+ _ = Builtin . createAsyncTaskInGroupWithExecutor ( flags, _group, executorBuiltin, operation)
258239 #else
259240 fatalError ( " Unsupported Swift compiler " )
260241 #endif
@@ -290,22 +271,19 @@ extension DiscardingTaskGroup {
290271 }
291272 let flags = taskCreateFlags (
292273 priority: priority, isChildTask: true , copyTaskLocals: false ,
293- inheritContext: false , enqueueJob: false ,
274+ inheritContext: false , enqueueJob: true ,
294275 addPendingGroupTaskUnconditionally: false , isDiscardingTask: true
295276 )
296277
278+ let executorBuiltin : Builtin . Executor =
297279 if let taskExecutor {
298- let executorBuiltin : Builtin . Executor =
299- taskExecutor. asUnownedTaskExecutor ( ) . executor
300-
301- // Create the task in this group with an executor preference.
302- _ = Builtin . createAsyncTaskInGroupWithExecutor ( flags, _group, executorBuiltin, operation)
280+ taskExecutor. asUnownedTaskExecutor ( ) . executor
303281 } else {
304- // FIXME: DISABLE THE TASK PREFERENCE (PASS NIL?)
305- // Create the task in this group without executor preference.
306- fatalError ( " NOT YET " ) // _ = Builtin.createAsyncTaskInGroup(flags, _group, operation)
282+ _getUndefinedTaskExecutor ( )
307283 }
308284
285+ // Create the task in this group with an executor preference.
286+ _ = Builtin . createAsyncTaskInGroupWithExecutor ( flags, _group, executorBuiltin, operation)
309287 return true
310288 #else
311289 fatalError ( " Unsupported Swift compiler " )
@@ -338,21 +316,19 @@ extension ThrowingDiscardingTaskGroup {
338316 #if $BuiltinCreateAsyncTaskInGroupWithExecutor
339317 let flags = taskCreateFlags (
340318 priority: priority, isChildTask: true , copyTaskLocals: false ,
341- inheritContext: false , enqueueJob: false ,
319+ inheritContext: false , enqueueJob: true ,
342320 addPendingGroupTaskUnconditionally: true ,
343321 isDiscardingTask: true )
344322
323+ let executorBuiltin : Builtin . Executor =
345324 if let taskExecutor {
346- let executorBuiltin : Builtin . Executor =
347- taskExecutor. asUnownedTaskExecutor ( ) . executor
348-
349- // Create the task in this group with an executor preference.
350- _ = Builtin . createAsyncTaskInGroupWithExecutor ( flags, _group, executorBuiltin, operation)
325+ taskExecutor. asUnownedTaskExecutor ( ) . executor
351326 } else {
352- // FIXME: DISABLE THE TASK PREFERENCE (PASS NIL?)
353- // Create the task in this group without executor preference.
354- fatalError ( " NOT YET " ) // _ = Builtin.createAsyncTaskInGroup(flags, _group, operation)
327+ _getUndefinedTaskExecutor ( )
355328 }
329+
330+ // Create the task in this group with an executor preference.
331+ _ = Builtin . createAsyncTaskInGroupWithExecutor ( flags, _group, executorBuiltin, operation)
356332 #else
357333 fatalError ( " Unsupported Swift compiler " )
358334 #endif
@@ -389,22 +365,19 @@ extension ThrowingDiscardingTaskGroup {
389365 }
390366 let flags = taskCreateFlags (
391367 priority: priority, isChildTask: true , copyTaskLocals: false ,
392- inheritContext: false , enqueueJob: false ,
368+ inheritContext: false , enqueueJob: true ,
393369 addPendingGroupTaskUnconditionally: false , isDiscardingTask: true
394370 )
395371
372+ let executorBuiltin : Builtin . Executor =
396373 if let taskExecutor {
397- let executorBuiltin : Builtin . Executor =
398- taskExecutor. asUnownedTaskExecutor ( ) . executor
399-
400- // Create the task in this group with an executor preference.
401- _ = Builtin . createAsyncTaskInGroupWithExecutor ( flags, _group, executorBuiltin, operation)
374+ taskExecutor. asUnownedTaskExecutor ( ) . executor
402375 } else {
403- // FIXME: DISABLE THE TASK PREFERENCE (PASS NIL?)
404- // Create the task in this group without executor preference.
405- fatalError ( " NOT YET " ) // _ = Builtin.createAsyncTaskInGroup(flags, _group, operation)
376+ _getUndefinedTaskExecutor ( )
406377 }
407378
379+ // Create the task in this group with an executor preference.
380+ _ = Builtin . createAsyncTaskInGroupWithExecutor ( flags, _group, executorBuiltin, operation)
408381 return true
409382 #else
410383 fatalError ( " Unsupported Swift compiler " )
0 commit comments