Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit a229aba

Browse files
committed
Add note specifying that assumeUnshared is transitive
1 parent ea60beb commit a229aba

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/core/atomic.d

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,10 +293,13 @@ in (atomicPtrIsProperlyAligned(here), "Argument `here` is not properly aligned")
293293
*
294294
* Note: this function does not perform any ordering.
295295
*
296-
* Note: assumeUnshared is a special-purpose primitive and should be used with care. When accessing
296+
* Note: `assumeUnshared` is a special-purpose primitive and should be used with care. When accessing
297297
* shared variables both inside and outside of synchronized blocks, atomic operations should be
298298
* used instead.
299299
*
300+
* Note: the result of assumeUnshared is an object for which `shared` has been stripped transitively.
301+
* Therefore, any field that is accessed from the assumed unshared object will also be unshared.
302+
*
300303
* Params:
301304
* val = the shared lvalue.
302305
*

0 commit comments

Comments
 (0)