File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
stdlib/public/Concurrency Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -411,6 +411,11 @@ SWIFT_CC(swift)
411
411
static bool swift_task_hasTaskGroupStatusRecordImpl() {
412
412
auto task = swift_task_getCurrent ();
413
413
414
+ // a group must be in a task, so if we're not in a task...
415
+ // then, we certainly are not in a group either!
416
+ if (!task)
417
+ return false ;
418
+
414
419
Optional<StatusRecordLockRecord> recordLockRecord;
415
420
416
421
// Acquire the status record lock.
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ func printTaskLocal<V>(
33
33
// ==== ------------------------------------------------------------------------
34
34
35
35
@available ( SwiftStdlib 5 . 5 , * )
36
- func synchronous_bind( ) async {
36
+ func synchronous_bind( ) {
37
37
38
38
func synchronous( ) {
39
39
printTaskLocal ( TL . $number) // CHECK: TaskLocal<Int>(defaultValue: 0) (1111)
@@ -45,14 +45,14 @@ func synchronous_bind() async {
45
45
printTaskLocal ( TL . $number) // CHECK: TaskLocal<Int>(defaultValue: 0) (1111)
46
46
}
47
47
48
- await TL . $number. withValue ( 1111 ) {
48
+ TL . $number. withValue ( 1111 ) {
49
49
synchronous ( )
50
50
}
51
51
}
52
52
53
53
@available ( SwiftStdlib 5 . 5 , * )
54
54
@main struct Main {
55
- static func main( ) async {
56
- await synchronous_bind ( )
55
+ static func main( ) {
56
+ synchronous_bind ( )
57
57
}
58
58
}
You can’t perform that action at this time.
0 commit comments