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)
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