File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
stdlib/public/Concurrency Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -478,20 +478,21 @@ public func _runAsyncHandler(operation: @escaping () async -> ()) {
478
478
///
479
479
/// This function does _not_ block the underlying thread.
480
480
public static func sleep( _ duration: UInt64 ) async {
481
-
482
481
// Set up the job flags for a new task.
483
482
var flags = JobFlags ( )
484
483
flags. kind = . task
485
484
flags. priority = . default
486
485
flags. isFuture = true
487
486
488
487
// Create the asynchronous task future.
489
- let ( task, _) = Builtin . createAsyncTaskFuture ( flags. bits, nil , { } )
488
+ // FIXME: This should be an empty closure instead. Returning `0` here is
489
+ // a workaround for rdar://74957357
490
+ let ( task, _) = Builtin . createAsyncTaskFuture ( flags. bits, nil , { return 0 } )
490
491
491
492
// Enqueue the resulting job.
492
493
_enqueueJobGlobalWithDelay ( duration, Builtin . convertTaskToJob ( task) )
493
494
494
- let _ = await Handle < Void , Never > ( task) . get ( )
495
+ let _ = await Handle < Int , Never > ( task) . get ( )
495
496
}
496
497
// ==== UnsafeCurrentTask ------------------------------------------------------
497
498
You can’t perform that action at this time.
0 commit comments