@@ -200,27 +200,27 @@ while this code waits for the picture to be ready.
200200To understand the concurrent nature of the example above,
201201here's one possible order of execution:
202202
203- - The code starts running from the first line
203+ 1 . The code starts running from the first line
204204 and runs up to the first ` await ` .
205205 It calls the ` listPhotos(inGallery:) ` function
206206 and suspends execution while it waits for that function to return.
207- - While this code's execution is suspended,
207+ 2 . While this code's execution is suspended,
208208 some other concurrent code in the same program runs.
209209 For example, maybe a long-running background task
210210 continues updating a list of new photo galleries.
211211 That code also runs until the next suspension point, marked by ` await ` ,
212212 or until it completes.
213- - After ` listPhotos(inGallery:) ` returns,
213+ 3 . After ` listPhotos(inGallery:) ` returns,
214214 this code continues execution starting at that point.
215215 It assigns the value that was returned to ` photoNames ` .
216- - The lines that define ` sortedNames ` and ` name `
216+ 4 . The lines that define ` sortedNames ` and ` name `
217217 are regular, synchronous code.
218218 Because nothing is marked ` await ` on these lines,
219219 there aren't any possible suspension points.
220- - The next ` await ` marks the call to the ` downloadPhoto(named:) ` function.
220+ 5 . The next ` await ` marks the call to the ` downloadPhoto(named:) ` function.
221221 This code pauses execution again until that function returns,
222222 giving other concurrent code an opportunity to run.
223- - After ` downloadPhoto(named:) ` returns,
223+ 6 . After ` downloadPhoto(named:) ` returns,
224224 its return value is assigned to ` photo `
225225 and then passed as an argument when calling ` show(_:) ` .
226226
0 commit comments