Skip to content

Commit 073082b

Browse files
committed
Fix comment atomics.h.
I appear to accidentally have switched the comments for pg_atomic_write_u32 and pg_atomic_read_u32 around. Also fix some minor typos I found while fixing. Noticed-By: Amit Kapila Backpatch: 9.5
1 parent 1b5d34c commit 073082b

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/include/port/atomics.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
* new platform. If no such generic implementation is available spinlocks (or
1919
* even OS provided semaphores) will be used to implement the API.
2020
*
21-
* Implement the _u64 variantes if and only if your platform can use them
21+
* Implement the _u64 variants if and only if your platform can use them
2222
* efficiently (and obviously correctly).
2323
*
2424
* Use higher level functionality (lwlocks, spinlocks, heavyweight locks)
@@ -46,7 +46,7 @@
4646
*
4747
* These files can provide the full set of atomics or can do pretty much
4848
* nothing if all the compilers commonly used on these platforms provide
49-
* useable generics.
49+
* usable generics.
5050
*
5151
* Don't add an inline assembly of the actual atomic operations if all the
5252
* common implementations of your platform provide intrinsics. Intrinsics are
@@ -280,10 +280,12 @@ pg_atomic_init_u32(volatile pg_atomic_uint32 *ptr, uint32 val)
280280
}
281281

282282
/*
283-
* pg_atomic_write_u32 - unlocked write to atomic variable.
283+
* pg_atomic_read_u32 - unlocked read from atomic variable.
284284
*
285-
* The write is guaranteed to succeed as a whole, i.e. it's not possible to
286-
* observe a partial write for any reader.
285+
* The read is guaranteed to return a value as it has been written by this or
286+
* another process at some point in the past. There's however no cache
287+
* coherency interaction guaranteeing the value hasn't since been written to
288+
* again.
287289
*
288290
* No barrier semantics.
289291
*/
@@ -295,12 +297,10 @@ pg_atomic_read_u32(volatile pg_atomic_uint32 *ptr)
295297
}
296298

297299
/*
298-
* pg_atomic_read_u32 - unlocked read from atomic variable.
300+
* pg_atomic_write_u32 - unlocked write to atomic variable.
299301
*
300-
* The read is guaranteed to return a value as it has been written by this or
301-
* another process at some point in the past. There's however no cache
302-
* coherency interaction guaranteeing the value hasn't since been written to
303-
* again.
302+
* The write is guaranteed to succeed as a whole, i.e. it's not possible to
303+
* observe a partial write for any reader.
304304
*
305305
* No barrier semantics.
306306
*/

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy