Skip to content

Commit 54e78cc

Browse files
committed
Fix after rebase
1 parent 4bb52cc commit 54e78cc

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

stdlib/public/Concurrency/Task.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,9 @@ public func _runAsyncHandler(operation: @escaping () async -> ()) {
472472
)
473473
}
474474

475+
// ==== Async Sleep ------------------------------------------------------------
475476

477+
extension Task {
476478
/// Suspends the current task for _at least_ the given duration
477479
/// in nanoseconds.
478480
///
@@ -494,6 +496,8 @@ public func _runAsyncHandler(operation: @escaping () async -> ()) {
494496

495497
let _ = await Handle<Int, Never>(task).get()
496498
}
499+
}
500+
497501
// ==== UnsafeCurrentTask ------------------------------------------------------
498502

499503
extension Task {

test/Concurrency/Runtime/async_task_sleep.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-run-simple-swift(-Xfrontend -enable-experimental-concurrency -parse-as-library)
1+
// RUN: %target-run-simple-swift(-Xfrontend -enable-experimental-concurrency -parse-as-library) | %FileCheck %s --dump-input always
22
// REQUIRES: executable_test
33
// REQUIRES: concurrency
44

@@ -35,6 +35,8 @@ import Dispatch
3535

3636
print("Run second")
3737

38+
// CHECK: Run first
39+
// CHECK: Run second
3840
await task.get()
3941
}
4042
}

0 commit comments

Comments
 (0)