Skip to content

Commit 7a57e7c

Browse files
authored
Spelling stdlib/public/concurrency (#42443)
* spelling: already Signed-off-by: Josh Soref <[email protected]> * spelling: appropriate Signed-off-by: Josh Soref <[email protected]> * spelling: asynchronous Signed-off-by: Josh Soref <[email protected]> * spelling: cancel Signed-off-by: Josh Soref <[email protected]> * spelling: divisible Signed-off-by: Josh Soref <[email protected]> * spelling: execution Signed-off-by: Josh Soref <[email protected]> * spelling: initialized Signed-off-by: Josh Soref <[email protected]> * spelling: normally Signed-off-by: Josh Soref <[email protected]> * spelling: preprocessed Signed-off-by: Josh Soref <[email protected]> * spelling: priority Signed-off-by: Josh Soref <[email protected]> * spelling: some Signed-off-by: Josh Soref <[email protected]> * spelling: success Signed-off-by: Josh Soref <[email protected]> * spelling: suspending Signed-off-by: Josh Soref <[email protected]> * spelling: the Signed-off-by: Josh Soref <[email protected]> * spelling: throws Signed-off-by: Josh Soref <[email protected]> Co-authored-by: Josh Soref <[email protected]>
1 parent f0a7358 commit 7a57e7c

12 files changed

+32
-32
lines changed

stdlib/public/Concurrency/Actor.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ void swift::runJobInEstablishedExecutorContext(Job *job) {
235235
task->runInFullyEstablishedContext();
236236

237237
assert(ActiveTask::get() == nullptr &&
238-
"active task wasn't cleared before susspending?");
238+
"active task wasn't cleared before suspending?");
239239
} else {
240240
// There's no extra bookkeeping to do for simple jobs besides swapping in
241241
// the voucher.
@@ -459,7 +459,7 @@ class JobRef {
459459
return { job, 0 };
460460
}
461461

462-
/// Return a reference to a job that hasn't been preprocesssed yet.
462+
/// Return a reference to a job that hasn't been preprocessed yet.
463463
static JobRef getUnpreprocessed(Job *job) {
464464
assert(job && "passing a null job");
465465
return { job, NeedsPreprocessing };
@@ -940,7 +940,7 @@ class DefaultActorImpl : public HeapObject {
940940

941941
/// Schedule a processing job. This can generally only be
942942
/// done if we know nobody else is trying to do it at the same time,
943-
/// e.g. if this thread just sucessfully transitioned the actor from
943+
/// e.g. if this thread just successfully transitioned the actor from
944944
/// Idle to Scheduled.
945945
void scheduleActorProcessJob(JobPriority priority);
946946
};
@@ -1387,7 +1387,7 @@ Job * DefaultActorImpl::drainOne() {
13871387
// Dequeue the first job and set up a new head
13881388
newState = newState.withFirstJob(getNextJobInQueue(firstJob));
13891389
if (_status().compare_exchange_weak(oldState, newState,
1390-
/* sucess */ std::memory_order_release,
1390+
/* success */ std::memory_order_release,
13911391
/* failure */ std::memory_order_acquire)) {
13921392
SWIFT_TASK_DEBUG_LOG("Drained first job %p from actor %p", firstJob, this);
13931393
traceActorStateTransition(this, oldState, newState);
@@ -1650,7 +1650,7 @@ static void runOnAssumedThread(AsyncTask *task, ExecutorRef executor,
16501650
// Note that this doesn't change the active task and so doesn't
16511651
// need to either update ActiveTask or flagAsRunning/flagAsSuspended.
16521652

1653-
// If there's alreaady tracking info set up, just change the executor
1653+
// If there's already tracking info set up, just change the executor
16541654
// there and tail-call the task. We don't want these frames to
16551655
// potentially accumulate linearly.
16561656
if (oldTracking) {

stdlib/public/Concurrency/AsyncFlatMapSequence.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ extension AsyncSequence {
3838
/// - Parameter transform: A mapping closure. `transform` accepts an element
3939
/// of this sequence as its parameter and returns an `AsyncSequence`.
4040
/// - Returns: A single, flattened asynchronous sequence that contains all
41-
/// elements in all the asychronous sequences produced by `transform`.
41+
/// elements in all the asynchronous sequences produced by `transform`.
4242
@preconcurrency
4343
@inlinable
4444
public __consuming func flatMap<SegmentOfResult: AsyncSequence>(

stdlib/public/Concurrency/AsyncIteratorProtocol.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import Swift
2626
/// conforms to `AsyncIteratorProtocol`. The following example shows a `Counter`
2727
/// type that uses an inner iterator to monotonically generate `Int` values
2828
/// until reaching a `howHigh` value. While this example isn't itself
29-
/// asychronous, it shows the shape of a custom sequence and iterator, and how
29+
/// asynchronous, it shows the shape of a custom sequence and iterator, and how
3030
/// to use it as if it were asynchronous:
3131
///
3232
/// struct Counter : AsyncSequence {
@@ -37,7 +37,7 @@ import Swift
3737
/// let howHigh: Int
3838
/// var current = 1
3939
/// mutating func next() async -> Int? {
40-
/// // A genuinely asychronous implementation uses the `Task`
40+
/// // A genuinely asynchronous implementation uses the `Task`
4141
/// // API to check for cancellation here and return early.
4242
/// guard current <= howHigh else {
4343
/// return nil

stdlib/public/Concurrency/AsyncStream.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ public struct AsyncStream<Element> {
179179
let storage: _Storage
180180

181181
/// Resume the task awaiting the next iteration point by having it return
182-
/// nomally from its suspension point with a given element.
182+
/// normally from its suspension point with a given element.
183183
///
184184
/// - Parameter value: The value to yield from the continuation.
185185
/// - Returns: A `YieldResult` that indicates the success or failure of the
@@ -305,7 +305,7 @@ public struct AsyncStream<Element> {
305305
/// stream.
306306
/// - onCancel: A closure to execute when canceling the stream's task.
307307
///
308-
/// Use this convenience initializer when you have an asychronous function
308+
/// Use this convenience initializer when you have an asynchronous function
309309
/// that can produce elements for the stream, and don't want to invoke
310310
/// a continuation manually. This initializer "unfolds" your closure into
311311
/// an asynchronous stream. The created stream handles conformance

stdlib/public/Concurrency/AsyncThrowingFlatMapSequence.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ extension AsyncSequence {
5050
/// accepts an element of this sequence as its parameter and returns an
5151
/// `AsyncSequence`. If `transform` throws an error, the sequence ends.
5252
/// - Returns: A single, flattened asynchronous sequence that contains all
53-
/// elements in all the asychronous sequences produced by `transform`. The
54-
/// sequence ends either when the the last sequence created from the last
53+
/// elements in all the asynchronous sequences produced by `transform`. The
54+
/// sequence ends either when the last sequence created from the last
5555
/// element from base sequence ends, or when `transform` throws an error.
5656
@preconcurrency
5757
@inlinable

stdlib/public/Concurrency/AsyncThrowingStream.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ import Swift
5151
/// `Quake` instances every time it detects an earthquake. To receive callbacks,
5252
/// callers set a custom closure as the value of the monitor's
5353
/// `quakeHandler` property, which the monitor calls back as necessary. Callers
54-
/// can also set an `errorHandler` to receive asychronous error notifications,
54+
/// can also set an `errorHandler` to receive asynchronous error notifications,
5555
/// such as the monitor service suddenly becoming unavailable.
5656
///
5757
/// class QuakeMonitor {
@@ -201,7 +201,7 @@ public struct AsyncThrowingStream<Element, Failure: Error> {
201201
let storage: _Storage
202202

203203
/// Resume the task awaiting the next iteration point by having it return
204-
/// nomally from its suspension point with a given element.
204+
/// normally from its suspension point with a given element.
205205
///
206206
/// - Parameter value: The value to yield from the continuation.
207207
/// - Returns: A `YieldResult` that indicates the success or failure of the
@@ -283,7 +283,7 @@ public struct AsyncThrowingStream<Element, Failure: Error> {
283283
/// elements to the stream and terminate the stream when finished.
284284
///
285285
/// The `AsyncStream.Continuation` received by the `build` closure is
286-
/// appopriate for use in concurrent contexts. It is thread safe to send and
286+
/// appropriate for use in concurrent contexts. It is thread safe to send and
287287
/// finish; all calls are to the continuation are serialized. However, calling
288288
/// this from multiple concurrent contexts could result in out-of-order
289289
/// delivery.
@@ -292,7 +292,7 @@ public struct AsyncThrowingStream<Element, Failure: Error> {
292292
/// initializer that produces 100 random numbers on a one-second interval,
293293
/// calling `yield(_:)` to deliver each element to the awaiting call point.
294294
/// When the `for` loop exits, the stream finishes by calling the
295-
/// continuation's `finish()` method. If the random number is divisble by 5
295+
/// continuation's `finish()` method. If the random number is divisible by 5
296296
/// with no remainder, the stream throws a `MyRandomNumberError`.
297297
///
298298
/// let stream = AsyncThrowingStream<Int, Error>(Int.self,
@@ -338,7 +338,7 @@ public struct AsyncThrowingStream<Element, Failure: Error> {
338338
/// - produce: A closure that asynchronously produces elements for the
339339
/// stream.
340340
///
341-
/// Use this convenience initializer when you have an asychronous function
341+
/// Use this convenience initializer when you have an asynchronous function
342342
/// that can produce elements for the stream, and don't want to invoke
343343
/// a continuation manually. This initializer "unfolds" your closure into
344344
/// a full-blown asynchronous stream. The created stream handles adherence to
@@ -347,7 +347,7 @@ public struct AsyncThrowingStream<Element, Failure: Error> {
347347
///
348348
/// The following example shows an `AsyncThrowingStream` created with this
349349
/// initializer that produces random numbers on a one-second interval. If the
350-
/// random number is divisble by 5 with no remainder, the stream throws a
350+
/// random number is divisible by 5 with no remainder, the stream throws a
351351
/// `MyRandomNumberError`.
352352
///
353353
/// let stream = AsyncThrowingStream<Int, Error> {
@@ -455,7 +455,7 @@ extension AsyncThrowingStream.Continuation {
455455
}
456456

457457
/// Resume the task awaiting the next iteration point by having it return
458-
/// nomally from its suspension point.
458+
/// normally from its suspension point.
459459
///
460460
/// - Returns: A `YieldResult` that indicates the success or failure of the
461461
/// yield operation.

stdlib/public/Concurrency/GlobalExecutor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
/// threads from growing without limit.
2626
///
2727
/// Second, executors may own dedicated threads, or they may schedule
28-
/// work onto some some underlying executor. Dedicated threads can
28+
/// work onto some underlying executor. Dedicated threads can
2929
/// improve the responsiveness of a subsystem *locally*, but they impose
3030
/// substantial costs which can drive down performance *globally*
3131
/// if not used carefully. When an executor relies on running work

stdlib/public/Concurrency/Task.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,15 +106,15 @@ FutureFragment::Status AsyncTask::waitFuture(AsyncTask *waitingTask,
106106
auto fragment = futureFragment();
107107

108108
auto queueHead = fragment->waitQueue.load(std::memory_order_acquire);
109-
bool contextIntialized = false;
109+
bool contextInitialized = false;
110110
while (true) {
111111
switch (queueHead.getStatus()) {
112112
case Status::Error:
113113
case Status::Success:
114114
SWIFT_TASK_DEBUG_LOG("task %p waiting on task %p, completed immediately",
115115
waitingTask, this);
116116
_swift_tsan_acquire(static_cast<Job *>(this));
117-
if (contextIntialized) waitingTask->flagAsRunning();
117+
if (contextInitialized) waitingTask->flagAsRunning();
118118
// The task is done; we don't need to wait.
119119
return queueHead.getStatus();
120120

@@ -128,8 +128,8 @@ FutureFragment::Status AsyncTask::waitFuture(AsyncTask *waitingTask,
128128
break;
129129
}
130130

131-
if (!contextIntialized) {
132-
contextIntialized = true;
131+
if (!contextInitialized) {
132+
contextInitialized = true;
133133
auto context =
134134
reinterpret_cast<TaskFutureWaitAsyncContext *>(waitingTaskContext);
135135
context->errorResult = nullptr;
@@ -1100,7 +1100,7 @@ static void swift_continuation_awaitImpl(ContinuationAsyncContext *context) {
11001100
return context->ResumeParent(context);
11011101
}
11021102

1103-
// Load the current task (we alreaady did this in assertions builds).
1103+
// Load the current task (we already did this in assertions builds).
11041104
#ifdef NDEBUG
11051105
auto task = swift_task_getCurrent();
11061106
#endif

stdlib/public/Concurrency/TaskGroup.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ import Swift
4444
/// =======================
4545
///
4646
/// You can cancel a task group and all of its child tasks
47-
/// by calling the `cancellAll()` method on the task group,
47+
/// by calling the `cancelAll()` method on the task group,
4848
/// or by canceling the task in which the group is running.
4949
///
5050
/// If you call `async(priority:operation:)` to create a new task in a canceled group,
@@ -118,7 +118,7 @@ public func withTaskGroup<ChildTaskResult, GroupResult>(
118118
/// =======================
119119
///
120120
/// You can cancel a task group and all of its child tasks
121-
/// by calling the `cancellAll()` method on the task group,
121+
/// by calling the `cancelAll()` method on the task group,
122122
/// or by canceling the task in which the group is running.
123123
///
124124
/// If you call `async(priority:operation:)` to create a new task in a canceled group,
@@ -802,7 +802,7 @@ extension ThrowingTaskGroup: AsyncSequence {
802802
/// it's valid to make a new iterator for the task group,
803803
/// which you can use to iterate over the results of new tasks you add to the group.
804804
/// You can also make a new iterator to resume iteration
805-
/// after a child task thows an error.
805+
/// after a child task throws an error.
806806
/// For example:
807807
///
808808
/// group.addTask { 1 }

stdlib/public/Concurrency/TaskPrivate.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ class TaskFutureWaitAsyncContext : public AsyncContext {
212212
///
213213
/// 32 bit systems with SWIFT_CONCURRENCY_ENABLE_PRIORITY_ESCALATION=1
214214
///
215-
/// Flags Exeuction Lock Unused TaskStatusRecord *
215+
/// Flags Execution Lock Unused TaskStatusRecord *
216216
/// |----------------------|----------------------|----------------------|-------------------|
217217
/// 32 bits 32 bits 32 bits 32 bits
218218
///
@@ -732,7 +732,7 @@ retry:;
732732
/// task. Otherwise, if we reset the voucher and priority escalation too early, the
733733
/// thread may be preempted immediately before we can finish the enqueue of the
734734
/// high priority task to the next location. We will then have a priority inversion
735-
/// of waiting for a low priority thread to enqueue a high priorty task.
735+
/// of waiting for a low priority thread to enqueue a high priority task.
736736
///
737737
/// In order to do this correctly, we need enqueue-ing of a task to the next
738738
/// executor, to have a "hand-over-hand locking" type of behaviour - until the

stdlib/public/Distributed/DistributedActor.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ extension DistributedActor {
135135

136136
/// Executes the passed 'body' only when the distributed actor is local instance.
137137
///
138-
/// The `Self` passed to the the body closure is isolated, meaning that the
138+
/// The `Self` passed to the body closure is isolated, meaning that the
139139
/// closure can be used to call non-distributed functions, or even access actor
140140
/// state.
141141
///

stdlib/public/Distributed/DistributedActorSystem.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public protocol DistributedActorSystem: Sendable {
9696
Act.ID == ActorID
9797

9898
/// Called during when a distributed actor is deinitialized, or fails to initialize completely (e.g. by throwing
99-
/// out of an `init` that did not completely initialize all of the the actors stored properties yet).
99+
/// out of an `init` that did not completely initialize all of the actors stored properties yet).
100100
///
101101
/// This method is guaranteed to be called at-most-once for a given id (assuming IDs are unique,
102102
/// and not re-cycled by the system), i.e. if it is called during a failure to initialize completely,

0 commit comments

Comments
 (0)