| author | |
| committer | |
| log | 5ce40e61c6f5c05925aa5116cc6c61fbae8a6263 |
| tree | c2bdea1b2eeb0b2e9d551e6e5621390739818e3a |
| parent | cf4a2099e1e3c600ee65628153a280f5b2cd51fd |
| signature |
- complete std.builtin.AtomicOrder renames that were missed from 6067d39522f6 files changed, 15 insertions(+), 15 deletions(-)
lib/compiler_rt/emutls.zig+2-2| ... | ... | @@ -246,7 +246,7 @@ const emutls_control = extern struct { |
| 246 | 246 | // Two threads could race against the same emutls_control. |
| 247 | 247 | |
| 248 | 248 | // Use atomic for reading coherent value lockless. |
| 249 | const index_lockless = @atomicLoad(usize, &self.object.index, .Acquire); | |
| 249 | const index_lockless = @atomicLoad(usize, &self.object.index, .acquire); | |
| 250 | 250 | |
| 251 | 251 | if (index_lockless != 0) { |
| 252 | 252 | // index is already initialized, return it. |
| ... | ... | @@ -264,7 +264,7 @@ const emutls_control = extern struct { |
| 264 | 264 | } |
| 265 | 265 | |
| 266 | 266 | // Store a new index atomically (for having coherent index_lockless reading). |
| 267 | @atomicStore(usize, &self.object.index, emutls_control.next_index, .Release); | |
| 267 | @atomicStore(usize, &self.object.index, emutls_control.next_index, .release); | |
| 268 | 268 | |
| 269 | 269 | // Increment the next available index |
| 270 | 270 | emutls_control.next_index += 1; |
lib/std/Thread/Futex.zig+4-4| ... | ... | @@ -801,7 +801,7 @@ const PosixImpl = struct { |
| 801 | 801 | assert(std.c.pthread_mutex_lock(&bucket.mutex) == .SUCCESS); |
| 802 | 802 | defer assert(std.c.pthread_mutex_unlock(&bucket.mutex) == .SUCCESS); |
| 803 | 803 | |
| 804 | cancelled = ptr.load(.Monotonic) != expect; | |
| 804 | cancelled = ptr.load(.monotonic) != expect; | |
| 805 | 805 | if (cancelled) { |
| 806 | 806 | return; |
| 807 | 807 | } |
| ... | ... | @@ -855,14 +855,14 @@ const PosixImpl = struct { |
| 855 | 855 | // The pending count increment in wait() must also now use seq_cst for the update + this pending load |
| 856 | 856 | // to be in the same modification order as our load isn't using release/acquire to guarantee it. |
| 857 | 857 | bucket.pending.fence(.seq_cst); |
| 858 | if (bucket.pending.load(.Monotonic) == 0) { | |
| 858 | if (bucket.pending.load(.monotonic) == 0) { | |
| 859 | 859 | return; |
| 860 | 860 | } |
| 861 | 861 | |
| 862 | 862 | // Keep a list of all the waiters notified and wake then up outside the mutex critical section. |
| 863 | 863 | var notified = WaitList{}; |
| 864 | 864 | defer if (notified.len > 0) { |
| 865 | const pending = bucket.pending.fetchSub(notified.len, .Monotonic); | |
| 865 | const pending = bucket.pending.fetchSub(notified.len, .monotonic); | |
| 866 | 866 | assert(pending >= notified.len); |
| 867 | 867 | |
| 868 | 868 | while (notified.pop()) |waiter| { |
| ... | ... | @@ -875,7 +875,7 @@ const PosixImpl = struct { |
| 875 | 875 | defer assert(std.c.pthread_mutex_unlock(&bucket.mutex) == .SUCCESS); |
| 876 | 876 | |
| 877 | 877 | // Another pending check again to avoid the WaitQueue lookup if not necessary. |
| 878 | if (bucket.pending.load(.Monotonic) > 0) { | |
| 878 | if (bucket.pending.load(.monotonic) > 0) { | |
| 879 | 879 | notified = WaitQueue.remove(&bucket.treap, address, max_waiters); |
| 880 | 880 | } |
| 881 | 881 | } |
lib/std/Thread/RwLock.zig+1-1| ... | ... | @@ -375,5 +375,5 @@ test "concurrent access" { |
| 375 | 375 | |
| 376 | 376 | try testing.expectEqual(num_writes, runner.writes); |
| 377 | 377 | |
| 378 | //std.debug.print("reads={}\n", .{ runner.reads.load(.Unordered)}); | |
| 378 | //std.debug.print("reads={}\n", .{ runner.reads.load(.unordered)}); | |
| 379 | 379 | } |
lib/std/atomic.zig+1-1| ... | ... | @@ -159,7 +159,7 @@ test Value { |
| 159 | 159 | // acquire ensures count decrement and code before |
| 160 | 160 | // previous unrefs()s happens-before we call dropFn |
| 161 | 161 | // below. |
| 162 | // Another alternative is to use .AcqRel on the | |
| 162 | // Another alternative is to use .acq_rel on the | |
| 163 | 163 | // fetchSub count decrement but it's extra barrier in |
| 164 | 164 | // possibly hot path. |
| 165 | 165 | rc.count.fence(.acquire); |
src/Air.zig+3-3| ... | ... | @@ -727,11 +727,11 @@ pub const Inst = struct { |
| 727 | 727 | /// Result type is always `void`. |
| 728 | 728 | /// Uses the `bin_op` field. LHS is pointer, RHS is element. |
| 729 | 729 | atomic_store_unordered, |
| 730 | /// Same as `atomic_store_unordered` but with `AtomicOrder.Monotonic`. | |
| 730 | /// Same as `atomic_store_unordered` but with `AtomicOrder.monotonic`. | |
| 731 | 731 | atomic_store_monotonic, |
| 732 | /// Same as `atomic_store_unordered` but with `AtomicOrder.Release`. | |
| 732 | /// Same as `atomic_store_unordered` but with `AtomicOrder.release`. | |
| 733 | 733 | atomic_store_release, |
| 734 | /// Same as `atomic_store_unordered` but with `AtomicOrder.SeqCst`. | |
| 734 | /// Same as `atomic_store_unordered` but with `AtomicOrder.seq_cst`. | |
| 735 | 735 | atomic_store_seq_cst, |
| 736 | 736 | /// Atomically read-modify-write via a pointer. |
| 737 | 737 | /// Result type is the element type of the pointer. |
src/arch/sparc64/CodeGen.zig+4-4| ... | ... | @@ -647,10 +647,10 @@ fn genBody(self: *Self, body: []const Air.Inst.Index) InnerError!void { |
| 647 | 647 | .call_never_tail => try self.airCall(inst, .never_tail), |
| 648 | 648 | .call_never_inline => try self.airCall(inst, .never_inline), |
| 649 | 649 | |
| 650 | .atomic_store_unordered => @panic("TODO try self.airAtomicStore(inst, .Unordered)"), | |
| 651 | .atomic_store_monotonic => @panic("TODO try self.airAtomicStore(inst, .Monotonic)"), | |
| 652 | .atomic_store_release => @panic("TODO try self.airAtomicStore(inst, .Release)"), | |
| 653 | .atomic_store_seq_cst => @panic("TODO try self.airAtomicStore(inst, .SeqCst)"), | |
| 650 | .atomic_store_unordered => @panic("TODO try self.airAtomicStore(inst, .unordered)"), | |
| 651 | .atomic_store_monotonic => @panic("TODO try self.airAtomicStore(inst, .monotonic)"), | |
| 652 | .atomic_store_release => @panic("TODO try self.airAtomicStore(inst, .release)"), | |
| 653 | .atomic_store_seq_cst => @panic("TODO try self.airAtomicStore(inst, .seq_cst)"), | |
| 654 | 654 | |
| 655 | 655 | .struct_field_ptr_index_0 => try self.airStructFieldPtrIndex(inst, 0), |
| 656 | 656 | .struct_field_ptr_index_1 => try self.airStructFieldPtrIndex(inst, 1), |