18
18
* new platform. If no such generic implementation is available spinlocks (or
19
19
* even OS provided semaphores) will be used to implement the API.
20
20
*
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
22
22
* efficiently (and obviously correctly).
23
23
*
24
24
* Use higher level functionality (lwlocks, spinlocks, heavyweight locks)
46
46
*
47
47
* These files can provide the full set of atomics or can do pretty much
48
48
* nothing if all the compilers commonly used on these platforms provide
49
- * useable generics.
49
+ * usable generics.
50
50
*
51
51
* Don't add an inline assembly of the actual atomic operations if all the
52
52
* common implementations of your platform provide intrinsics. Intrinsics are
@@ -280,10 +280,12 @@ pg_atomic_init_u32(volatile pg_atomic_uint32 *ptr, uint32 val)
280
280
}
281
281
282
282
/*
283
- * pg_atomic_write_u32 - unlocked write to atomic variable.
283
+ * pg_atomic_read_u32 - unlocked read from atomic variable.
284
284
*
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.
287
289
*
288
290
* No barrier semantics.
289
291
*/
@@ -295,12 +297,10 @@ pg_atomic_read_u32(volatile pg_atomic_uint32 *ptr)
295
297
}
296
298
297
299
/*
298
- * pg_atomic_read_u32 - unlocked read from atomic variable.
300
+ * pg_atomic_write_u32 - unlocked write to atomic variable.
299
301
*
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.
304
304
*
305
305
* No barrier semantics.
306
306
*/
0 commit comments