Skip to content

Commit 6bb2bd2

Browse files
committed
Incorporated Alex's feedback.
1 parent 094837e commit 6bb2bd2

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

TSPL.docc/ReferenceManual/Attributes.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,10 @@ including important milestones.
216216

217217
Because Swift concurrency can resume on a different thread
218218
after a potential suspension point,
219-
you can't use elements like thread-local storage, locks, mutexes, and semaphores
220-
across suspension points. For example, accessing thread-local storage
221-
on both sides of a suspension point could produce unintended behaviors.
219+
you can't use elements like thread-local storage, locks, mutexes, or semaphores
220+
across suspension points.
221+
For example, accessing thread-local storage
222+
on both sides of a suspension point could produce incorrect results.
222223

223224
```swift
224225
let customThreadLog = "CustomThreadLog"
@@ -275,12 +276,12 @@ including important milestones.
275276
}
276277
```
277278

278-
While the `noasync` argument prevents accidental, unsafe use of a symbol,
279+
While declaring noasync availability prevents accidental, unsafe use of a symbol,
279280
it can also prevent safe uses.
280-
In many cases, `nonasync` symbols can still be used safely in specific situations.
281+
In some cases, the symbols can be used safely in specific situations.
281282
If you can ensure that a particular use is safe in an asynchronous context,
282283
wrap the symbol in a safe, synchronous function.
283-
You can then call that synchronous wrapper from your asynchronous context.
284+
You can then call the synchronous wrapper from your asynchronous code.
284285
The compiler won't raise an error, because the `noasync` symbol
285286
isn't used directly in an asynchronous context.
286287

@@ -296,15 +297,17 @@ including important milestones.
296297

297298
appendToLog("\(name) \(result ? "is" : "isn't") verified!\n\n")
298299

299-
// Multiple calls to safeVerify() may not occur on the same thread.
300+
// If this is called from an asynchronous context,
301+
// multiple calls to safeVerify() don't necessarily occur on the same thread,
302+
// and each thread has its own log.
300303
// Return the log for the current thread.
301304
return readLog() ?? "No log found."
302305
}
303306
```
304307

305-
You can use the `noasync` argument with most declarations;
306-
however, you can't use it when declaring destructors,
307-
because the system must be able to call destructors from any context.
308+
You can use noasync availability with most declarations;
309+
however, you can't use it when declaring destructors.
310+
The system must be able to call destructors from any context.
308311

309312
- The `message` argument provides a textual message that the compiler displays
310313
when emitting a warning or error about the use of a deprecated, obsoleted,

0 commit comments

Comments
 (0)