1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

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
This commit is contained in:
Andres Freund
2015-08-05 13:06:04 +02:00
parent 1b5d34ca62
commit 073082bbb1

View File

@ -18,7 +18,7 @@
* new platform. If no such generic implementation is available spinlocks (or * new platform. If no such generic implementation is available spinlocks (or
* even OS provided semaphores) will be used to implement the API. * even OS provided semaphores) will be used to implement the API.
* *
* Implement the _u64 variantes if and only if your platform can use them * Implement the _u64 variants if and only if your platform can use them
* efficiently (and obviously correctly). * efficiently (and obviously correctly).
* *
* Use higher level functionality (lwlocks, spinlocks, heavyweight locks) * Use higher level functionality (lwlocks, spinlocks, heavyweight locks)
@ -46,7 +46,7 @@
* *
* These files can provide the full set of atomics or can do pretty much * These files can provide the full set of atomics or can do pretty much
* nothing if all the compilers commonly used on these platforms provide * nothing if all the compilers commonly used on these platforms provide
* useable generics. * usable generics.
* *
* Don't add an inline assembly of the actual atomic operations if all the * Don't add an inline assembly of the actual atomic operations if all the
* common implementations of your platform provide intrinsics. Intrinsics are * common implementations of your platform provide intrinsics. Intrinsics are
@ -280,10 +280,12 @@ pg_atomic_init_u32(volatile pg_atomic_uint32 *ptr, uint32 val)
} }
/* /*
* pg_atomic_write_u32 - unlocked write to atomic variable. * pg_atomic_read_u32 - unlocked read from atomic variable.
* *
* The write is guaranteed to succeed as a whole, i.e. it's not possible to * The read is guaranteed to return a value as it has been written by this or
* observe a partial write for any reader. * another process at some point in the past. There's however no cache
* coherency interaction guaranteeing the value hasn't since been written to
* again.
* *
* No barrier semantics. * No barrier semantics.
*/ */
@ -295,12 +297,10 @@ pg_atomic_read_u32(volatile pg_atomic_uint32 *ptr)
} }
/* /*
* pg_atomic_read_u32 - unlocked read from atomic variable. * pg_atomic_write_u32 - unlocked write to atomic variable.
* *
* The read is guaranteed to return a value as it has been written by this or * The write is guaranteed to succeed as a whole, i.e. it's not possible to
* another process at some point in the past. There's however no cache * observe a partial write for any reader.
* coherency interaction guaranteeing the value hasn't since been written to
* again.
* *
* No barrier semantics. * No barrier semantics.
*/ */