Skip to content

Commit 8e88bbc

Browse files
authored
Fix typos in Concurrency (#379)
2 parents 6e6fe53 + 2b31212 commit 8e88bbc

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

TSPL.docc/LanguageGuide/Concurrency.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ Each task in a given task group has the same parent task,
555555
and each task can have child tasks.
556556
Because of the explicit relationship between tasks and task groups,
557557
this approach is called *structured concurrency*.
558-
The explicit parent-child relationships between tasks has several advantages:
558+
The explicit parent-child relationship between tasks has several advantages:
559559

560560
- In a parent task,
561561
you can't forget to wait for its child tasks to complete.
@@ -590,7 +590,7 @@ The code above creates a new task group,
590590
and then creates child tasks
591591
to download each photo in the gallery.
592592
Swift runs as many of these tasks concurrently as conditions allow.
593-
As soon a child task finishes downloading a photo,
593+
As soon as a child task finishes downloading a photo,
594594
that photo is displayed.
595595
There's no guarantee about the order that child tasks complete,
596596
so the photos from this gallery can be shown in any order.
@@ -669,7 +669,7 @@ Downloading pictures could take a long time
669669
if the pictures are large or the network is slow.
670670
To let the user stop this work,
671671
without waiting for all of the tasks to complete,
672-
the tasks need check for cancellation and stop running if they are canceled.
672+
the tasks need to check for cancellation and stop running if they are canceled.
673673
There are two ways a task can do this:
674674
by calling the [`Task.checkCancellation()`][] type method,
675675
or by reading the [`Task.isCancelled`][`Task.isCancelled` type] type property.
@@ -1092,7 +1092,7 @@ The code above is similar to
10921092
but the code in this example doesn't wait for the UI update.
10931093
You can also write `@MainActor` on a structure, class, or enumeration
10941094
to ensure all of its methods and all access to its properties
1095-
to run on the main actor:
1095+
run on the main actor:
10961096

10971097
```swift
10981098
@MainActor
@@ -1106,7 +1106,7 @@ The `PhotoGallery` structure in the code above
11061106
draws the photos on screen,
11071107
using the names from its `photoNames` property
11081108
to determine which photos to display.
1109-
Because `photoNames` effects the UI,
1109+
Because `photoNames` affects the UI,
11101110
code that changes it needs to run on the main actor
11111111
to serialize that access.
11121112

@@ -1369,7 +1369,7 @@ during that period of time.
13691369
In the future,
13701370
if you try to add concurrent code to this function,
13711371
introducing a possible suspension point,
1372-
you'll get compile-time error instead of introducing a bug.
1372+
you'll get a compile-time error instead of introducing a bug.
13731373

13741374

13751375
## Global Actors
@@ -1379,7 +1379,7 @@ An actor can normally have multiple instances,
13791379
each of which provides independent isolation.
13801380
This is why you declare all of an actor's isolated data
13811381
as instance properties of that actor.
1382-
However, because `MainActor` is singleton ---
1382+
However, because `MainActor` is a singleton ---
13831383
there is only ever a single instance of this type ---
13841384
the type alone is sufficient to identify the actor,
13851385
allowing you to mark main-actor isolation using just an attribute.

0 commit comments

Comments
 (0)