Skip to content

Commit 6a79590

Browse files
committed
Back out edits that are out of scope.
This includes: - Edits to /// comments for non-public symbols - Edits to // comments (not documentation) - Edits to warnings and other strings in code
1 parent 1036417 commit 6a79590

File tree

4 files changed

+51
-51
lines changed

4 files changed

+51
-51
lines changed

stdlib/public/Concurrency/Task.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ extension Task where Success == Never, Failure == Never {
284284
/// this property's value is `Priority.default`.
285285
public static var currentPriority: TaskPriority {
286286
withUnsafeCurrentTask { task in
287-
// If running on behalf of a task, use that task's priority.
287+
// If we are running on behalf of a task, use that task's priority.
288288
if let task = task {
289289
return task.priority
290290
}
@@ -307,7 +307,7 @@ extension TaskPriority {
307307

308308
/// Flags for schedulable jobs.
309309
///
310-
/// This is a port of the C++ FlagSet<!-- FIXME: Rewrite so you're not using FlagSet in the abstract. -->.
310+
/// This is a port of the C++ FlagSet.
311311
@available(SwiftStdlib 5.5, *)
312312
struct JobFlags {
313313
/// Kinds of schedulable jobs.
@@ -329,7 +329,7 @@ struct JobFlags {
329329
}
330330
}
331331

332-
/// Whether this is an asynchronous task.<!-- FIXME: All of these "Whether" statements need to be rewritten to be clearer. What does "Whether" tie into? That part of these one-line descriptions doesn't work. Fix here and throughout the remainder of these for this section. Also, should the lines terminate with a colon instead of a period? -->
332+
/// Whether this is an asynchronous task.
333333
var isAsyncTask: Bool { kind == .task }
334334

335335
/// The priority given to the job.
@@ -414,7 +414,7 @@ struct JobFlags {
414414

415415
// ==== Task Creation Flags --------------------------------------------------
416416

417-
/// Form task creation flags for use with the `createAsyncTask`<!-- FIXME: If this is an abstract, you'll need to rewrite so you're not including createAsyncTask here. --> built-ins<!-- FIXME: Hyphenate. -->.
417+
/// Form task creation flags for use with the createAsyncTask builtins.
418418
@available(SwiftStdlib 5.5, *)
419419
@_alwaysEmitIntoClient
420420
func taskCreateFlags(
@@ -878,8 +878,8 @@ func _getCurrentThreadPriority() -> Int
878878

879879
#if _runtime(_ObjC)
880880

881-
/// Intrinsic used by SILGen<!-- FIXME: Should this be in code font? --> to launch a task for bridging a Swift async method
882-
/// which was called through its ObjC<!-- FIXME: Should this be in code font? -->-exported completion-handlerbased API.
881+
/// Intrinsic used by SILGen to launch a task for bridging a Swift async method
882+
/// which was called through its ObjC-exported completion-handler-based API.
883883
@available(SwiftStdlib 5.5, *)
884884
@_alwaysEmitIntoClient
885885
@usableFromInline

stdlib/public/Concurrency/TaskCancellation.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ extension Task where Success == Never, Failure == Never {
9393
/// if the current task has been canceled<!-- FIXME: Passive; rewrite. -->.
9494
@available(SwiftStdlib 5.5, *)
9595
public struct CancellationError: Error {
96-
// No extra information; cancellation is intended to be light-weight.
96+
// no extra information, cancellation is intended to be light-weight
9797
public init() {}
9898
}
9999

stdlib/public/Concurrency/TaskGroup.swift

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ public struct TaskGroup<ChildTaskResult> {
270270
let canAdd = _taskGroupAddPendingTask(group: _group, unconditionally: false)
271271

272272
guard canAdd else {
273-
// The group is canceled and isn't accepting any new work.
273+
// the group is cancelled and is not accepting any new work
274274
return false
275275
}
276276

@@ -439,8 +439,8 @@ public struct TaskGroup<ChildTaskResult> {
439439
@frozen
440440
public struct ThrowingTaskGroup<ChildTaskResult, Failure: Error> {
441441

442-
/// The group task into which child tasks offer their results,
443-
/// and the `next()`<!-- FIXME: If this is an abstract, don't include anything styled in code font. --> function polls those results from.
442+
/// Group task into which child tasks offer their results,
443+
/// and the `next()` function polls those results from.
444444
@usableFromInline
445445
internal let _group: Builtin.RawPointer
446446

@@ -450,7 +450,7 @@ public struct ThrowingTaskGroup<ChildTaskResult, Failure: Error> {
450450
self._group = group
451451
}
452452

453-
/// Await all of the remaining tasks on this group.
453+
/// Await all the remaining tasks on this group.
454454
@usableFromInline
455455
internal mutating func awaitAllRemainingTasks() async {
456456
while true {
@@ -522,7 +522,7 @@ public struct ThrowingTaskGroup<ChildTaskResult, Failure: Error> {
522522
let canAdd = _taskGroupAddPendingTask(group: _group, unconditionally: false)
523523

524524
guard canAdd else {
525-
// The group is canceled and isn't accepting any new work.
525+
// the group is cancelled and is not accepting any new work
526526
return false
527527
}
528528

@@ -645,7 +645,7 @@ public struct ThrowingTaskGroup<ChildTaskResult, Failure: Error> {
645645

646646
return .success(success)
647647
} catch {
648-
return .failure(error as! Failure) // as!-safe, because we<!-- FIXME: Correct the use of first-person voice here and throughout. --> are only allowed to throw Failure (Error).
648+
return .failure(error as! Failure) // as!-safe, because we are only allowed to throw Failure (Error)
649649
}
650650
}
651651

@@ -734,7 +734,7 @@ extension TaskGroup: AsyncSequence {
734734
@usableFromInline
735735
var finished: Bool = false
736736

737-
// No public constructors.
737+
// no public constructors
738738
init(group: TaskGroup<ChildTaskResult>) {
739739
self.group = group
740740
}
@@ -821,7 +821,7 @@ extension ThrowingTaskGroup: AsyncSequence {
821821
@usableFromInline
822822
var finished: Bool = false
823823

824-
// No public constructors.
824+
// no public constructors
825825
init(group: ThrowingTaskGroup<ChildTaskResult, Failure>) {
826826
self.group = group
827827
}
@@ -880,8 +880,8 @@ func _taskGroupAddPendingTask(
880880
@_silgen_name("swift_taskGroup_cancelAll")
881881
func _taskGroupCancelAll(group: Builtin.RawPointer)
882882

883-
/// Checks only if the group was specifically canceled<!-- FIXME: Passive; rewrite. -->.
884-
/// The task itself being canceled<!-- FIXME: Passive; rewrite. --> must be checked<!-- FIXME: Passive; rewrite. --> separately.
883+
/// Checks ONLY if the group was specifically canceled.
884+
/// The task itself being canceled must be checked separately.
885885
@available(SwiftStdlib 5.5, *)
886886
@_silgen_name("swift_taskGroup_isCancelled")
887887
func _taskGroupIsCancelled(group: Builtin.RawPointer) -> Bool

stdlib/public/Concurrency/TaskSleep.swift

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,19 @@ extension Task where Success == Never, Failure == Never {
3333

3434
/// Describes the state of a sleep() operation.
3535
private enum SleepState {
36-
/// The sleep continuation hasn't begun.
36+
/// The sleep continuation has not yet begun.
3737
case notStarted
3838

39-
// The sleep continuation has been created<!-- FIXME: Passive; rewrite. --> and is available here.
39+
// The sleep continuation has been created and is available here.
4040
case activeContinuation(SleepContinuation)
4141

42-
/// The sleep has finished<!-- FIXME: Passive; rewrite. -->.
42+
/// The sleep has finished.
4343
case finished
4444

45-
/// The sleep was canceled<!-- FIXME: Passive; rewrite. -->.
45+
/// The sleep was canceled.
4646
case cancelled
4747

48-
/// The sleep was canceled<!-- FIXME: Passive; rewrite. --> before it even started<!-- FIXME: Passive; rewrite. -->.
48+
/// The sleep was canceled before it even got started.
4949
case cancelledBeforeStarted
5050

5151
/// Decode sleep state from the word of storage.
@@ -75,12 +75,12 @@ extension Task where Success == Never, Failure == Never {
7575
}
7676
}
7777

78-
/// Decode the sleep state by loading from the given pointer.
78+
/// Decode sleep state by loading from the given pointer
7979
init(loading wordPtr: UnsafeMutablePointer<Builtin.Word>) {
8080
self.init(word: Builtin.atomicload_seqcst_Word(wordPtr._rawValue))
8181
}
8282

83-
/// Encode the sleep state into a word of storage.
83+
/// Encode sleep state into a word of storage.
8484
var word: UInt {
8585
switch self {
8686
case .notStarted:
@@ -102,8 +102,8 @@ extension Task where Success == Never, Failure == Never {
102102
}
103103
}
104104

105-
/// Called when the sleep(nanoseconds:)<!-- FIXME: If this is an abstract, remove the symbol and use an English language equivalent. --> operation woke up without being
106-
/// canceled<!-- FIXME: Passive; rewrite. -->.
105+
/// Called when the sleep(nanoseconds:) operation woke up without being
106+
/// canceled.
107107
private static func onSleepWake(
108108
_ wordPtr: UnsafeMutablePointer<Builtin.Word>
109109
) {
@@ -114,39 +114,39 @@ extension Task where Success == Never, Failure == Never {
114114
fatalError("Cannot wake before we even started")
115115

116116
case .activeContinuation(let continuation):
117-
// We<!-- FIXME: Correct the use of first person voice here and throughout. Comments, even those that don't get published, should follow Apple Style. --> have an active continuation, so try to transition to the
117+
// We have an active continuation, so try to transition to the
118118
// "finished" state.
119119
let (_, won) = Builtin.cmpxchg_seqcst_seqcst_Word(
120120
wordPtr._rawValue,
121121
state.word._builtinWordValue,
122122
SleepState.finished.word._builtinWordValue)
123123
if Bool(_builtinBooleanLiteral: won) {
124-
// The sleep finished, so invoke the continuation: we're<!-- FIXME: Fix voice. --> done.
124+
// The sleep finished, so invoke the continuation: we're done.
125125
continuation.resume()
126126
return
127127
}
128128

129-
// Try again.
129+
// Try again!
130130
continue
131131

132132
case .finished:
133-
fatalError("Already finished normally, can't do that again.")
133+
fatalError("Already finished normally, can't do that again")
134134

135135
case .cancelled:
136-
// The task was canceled, which means the continuation was
137-
// called by the cancellation handler. We<!-- FIXME: Fix voice. --> need to deallocate the flag
136+
// The task was cancelled, which means the continuation was
137+
// called by the cancellation handler. We need to deallocate the flag
138138
// word, because it was left over for this task to complete.
139139
wordPtr.deallocate()
140140
return
141141

142142
case .cancelledBeforeStarted:
143-
// Nothing to do.
143+
// Nothing to do;
144144
return
145145
}
146146
}
147147
}
148148

149-
/// Called when the sleep(nanoseconds:)<!-- FIXME: If this is an abstract, remove the symbol and use an English language equivalent. --> operation has been canceled<!-- FIXME: Passive; rewrite. --> before
149+
/// Called when the sleep(nanoseconds:) operation has been canceled before
150150
/// the sleep completed.
151151
private static func onSleepCancel(
152152
_ wordPtr: UnsafeMutablePointer<Builtin.Word>
@@ -155,7 +155,7 @@ extension Task where Success == Never, Failure == Never {
155155
let state = SleepState(loading: wordPtr)
156156
switch state {
157157
case .notStarted:
158-
// We<!-- FIXME: Fix voice. --> haven't started yet, so try to transition to the cancelled-before
158+
// We haven't started yet, so try to transition to the cancelled-before
159159
// started state.
160160
let (_, won) = Builtin.cmpxchg_seqcst_seqcst_Word(
161161
wordPtr._rawValue,
@@ -165,24 +165,24 @@ extension Task where Success == Never, Failure == Never {
165165
return
166166
}
167167

168-
// Try again.
168+
// Try again!
169169
continue
170170

171171
case .activeContinuation(let continuation):
172-
// We<!-- FIXME: Fix voice. --> have an active continuation, so try to transition to the
172+
// We have an active continuation, so try to transition to the
173173
// "cancelled" state.
174174
let (_, won) = Builtin.cmpxchg_seqcst_seqcst_Word(
175175
wordPtr._rawValue,
176176
state.word._builtinWordValue,
177177
SleepState.cancelled.word._builtinWordValue)
178178
if Bool(_builtinBooleanLiteral: won) {
179-
// We<!-- FIXME: Fix voice. --> recorded the task cancellation before the sleep finished, so
179+
// We recorded the task cancellation before the sleep finished, so
180180
// invoke the continuation with the cancellation error.
181181
continuation.resume(throwing: _Concurrency.CancellationError())
182182
return
183183
}
184184

185-
// Try again.
185+
// Try again!
186186
continue
187187

188188
case .finished, .cancelled, .cancelledBeforeStarted:
@@ -202,7 +202,7 @@ extension Task where Success == Never, Failure == Never {
202202
let wordPtr = UnsafeMutablePointer<Builtin.Word>.allocate(capacity: 1)
203203

204204
// Initialize the flag word to "not started", which means the continuation
205-
// has neither been created nor completed<!-- FIXME: Passive; rewrite. -->.
205+
// has neither been created nor completed.
206206
Builtin.atomicstore_seqcst_Word(
207207
wordPtr._rawValue, SleepState.notStarted.word._builtinWordValue)
208208

@@ -225,13 +225,13 @@ extension Task where Success == Never, Failure == Never {
225225
state.word._builtinWordValue,
226226
continuationWord._builtinWordValue)
227227
if !Bool(_builtinBooleanLiteral: won) {
228-
// Keep trying.
228+
// Keep trying!
229229
continue
230230
}
231231

232232
// Create a task that resumes the continuation normally if it
233233
// finishes first. Enqueue it directly with the delay, so it fires
234-
// when we're<!-- FIXME: Fix voice. --> done sleeping.
234+
// when we're done sleeping.
235235
let sleepTaskFlags = taskCreateFlags(
236236
priority: nil, isChildTask: false, copyTaskLocals: false,
237237
inheritContext: false, enqueueJob: false,
@@ -244,14 +244,14 @@ extension Task where Success == Never, Failure == Never {
244244
return
245245

246246
case .activeContinuation, .finished:
247-
fatalError("Impossible to have multiple active continuations.")
247+
fatalError("Impossible to have multiple active continuations")
248248

249249
case .cancelled:
250-
fatalError("Impossible to have canceled before we<!-- FIXME: Fix voice. --> began.")
250+
fatalError("Impossible to have cancelled before we began")
251251

252252
case .cancelledBeforeStarted:
253-
// Finish the continuation normally. We'll<!-- FIXME: Fix voice. --> throw later, after
254-
// we<!-- FIXME: Fix voice. --> clean up.
253+
// Finish the continuation normally. We'll throw later, after
254+
// we clean up.
255255
continuation.resume()
256256
return
257257
}
@@ -261,11 +261,11 @@ extension Task where Success == Never, Failure == Never {
261261
onSleepCancel(wordPtr)
262262
}
263263

264-
// Determine whether we<!-- FIXME: Fix voice. --> got canceled before we<!-- FIXME: Fix voice. --> even started.
264+
// Determine whether we got cancelled before we even started.
265265
let cancelledBeforeStarted: Bool
266266
switch SleepState(loading: wordPtr) {
267267
case .notStarted, .activeContinuation, .cancelled:
268-
fatalError("Invalid state for an uncanceled sleep task.")
268+
fatalError("Invalid state for non-cancelled sleep task")
269269

270270
case .cancelledBeforeStarted:
271271
cancelledBeforeStarted = true
@@ -274,17 +274,17 @@ extension Task where Success == Never, Failure == Never {
274274
cancelledBeforeStarted = false
275275
}
276276

277-
// We<!-- FIXME: Fix voice. --> got here without being canceled<!-- FIXME: Passive; rewrite. -->, so deallocate the storage for
277+
// We got here without being cancelled, so deallocate the storage for
278278
// the flag word and continuation.
279279
wordPtr.deallocate()
280280

281-
// If we<!-- FIXME: Fix voice. --> got canceled before w<!-- FIXME: Fix voice. -->e even started, through the cancellation
281+
// If we got cancelled before we even started, through the cancellation
282282
// error now.
283283
if cancelledBeforeStarted {
284284
throw _Concurrency.CancellationError()
285285
}
286286
} catch {
287-
// The task was canceled<!-- FIXME: Passive; rewrite. -->; propagate the error. The "on wake" task is
287+
// The task was cancelled; propagate the error. The "on wake" task is
288288
// responsible for deallocating the flag word and continuation, if it's
289289
// still running.
290290
throw error

0 commit comments

Comments
 (0)