Skip to content

Commit 020a5b9

Browse files
committed
[Concurrency] Properly set task create flags in TaskGroup.startTaskSynchronously
rdar://147907609 When starting tasks synchronously on task groups, the task create flags for isSynchronousStart and isDiscardingTask were always set to `false`. With this change the former will always be `true` and the latter conditionally `true` for discarding task groups.
1 parent fc16f3f commit 020a5b9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

stdlib/public/Concurrency/Task+startSynchronously.swift.gyb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,8 @@ extension Task where Failure == ${FAILURE_TYPE} {
230230
inheritContext: true,
231231
enqueueJob: false,
232232
addPendingGroupTaskUnconditionally: false,
233-
isDiscardingTask: false,
234-
isSynchronousStart: false
233+
isDiscardingTask: ${'true' if 'Discarding' in GROUP_TYPE else 'false'},
234+
isSynchronousStart: true
235235
)
236236

237237
let (task, _) = Builtin.createAsyncTask(flags, operation)
@@ -249,4 +249,4 @@ extension Task where Failure == ${FAILURE_TYPE} {
249249
internal func _startTaskOnMainActor(_ task: Builtin.NativeObject)
250250

251251
@_silgen_name("swift_task_startSynchronously")
252-
internal func _startTaskSynchronously(_ task: Builtin.NativeObject)
252+
internal func _startTaskSynchronously(_ task: Builtin.NativeObject)

0 commit comments

Comments
 (0)