aboutsummaryrefslogtreecommitdiff
path: root/lib/std/Thread
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2024-03-15 16:59:05 -0700
committerGitHub <noreply@github.com>2024-03-15 16:59:05 -0700
commitce4245f873c68cfcc431deb303383f25f6d50855 (patch)
treebe29f6d6d6bfa1c8fc7a8f20d61f19215a62554a /lib/std/Thread
parentcb419a1a8692cdbd612c6b63b65ba9a02e23c6c1 (diff)
parentd7cf25f5ca40e5cbcd739911e773769a62c2abe1 (diff)
downloadzig-ce4245f873c68cfcc431deb303383f25f6d50855.tar.gz
zig-ce4245f873c68cfcc431deb303383f25f6d50855.zip
Merge pull request #19312 from mikdusan/bsd-debitrot
bsd: debitrot
Diffstat (limited to 'lib/std/Thread')
-rw-r--r--lib/std/Thread/Futex.zig8
-rw-r--r--lib/std/Thread/RwLock.zig2
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/std/Thread/Futex.zig b/lib/std/Thread/Futex.zig
index 160d983c71..764d3f13e1 100644
--- a/lib/std/Thread/Futex.zig
+++ b/lib/std/Thread/Futex.zig
@@ -801,7 +801,7 @@ const PosixImpl = struct {
assert(std.c.pthread_mutex_lock(&bucket.mutex) == .SUCCESS);
defer assert(std.c.pthread_mutex_unlock(&bucket.mutex) == .SUCCESS);
- cancelled = ptr.load(.Monotonic) != expect;
+ cancelled = ptr.load(.monotonic) != expect;
if (cancelled) {
return;
}
@@ -855,14 +855,14 @@ const PosixImpl = struct {
// The pending count increment in wait() must also now use seq_cst for the update + this pending load
// to be in the same modification order as our load isn't using release/acquire to guarantee it.
bucket.pending.fence(.seq_cst);
- if (bucket.pending.load(.Monotonic) == 0) {
+ if (bucket.pending.load(.monotonic) == 0) {
return;
}
// Keep a list of all the waiters notified and wake then up outside the mutex critical section.
var notified = WaitList{};
defer if (notified.len > 0) {
- const pending = bucket.pending.fetchSub(notified.len, .Monotonic);
+ const pending = bucket.pending.fetchSub(notified.len, .monotonic);
assert(pending >= notified.len);
while (notified.pop()) |waiter| {
@@ -875,7 +875,7 @@ const PosixImpl = struct {
defer assert(std.c.pthread_mutex_unlock(&bucket.mutex) == .SUCCESS);
// Another pending check again to avoid the WaitQueue lookup if not necessary.
- if (bucket.pending.load(.Monotonic) > 0) {
+ if (bucket.pending.load(.monotonic) > 0) {
notified = WaitQueue.remove(&bucket.treap, address, max_waiters);
}
}
diff --git a/lib/std/Thread/RwLock.zig b/lib/std/Thread/RwLock.zig
index 2152c0756c..c4a8755907 100644
--- a/lib/std/Thread/RwLock.zig
+++ b/lib/std/Thread/RwLock.zig
@@ -375,5 +375,5 @@ test "concurrent access" {
try testing.expectEqual(num_writes, runner.writes);
- //std.debug.print("reads={}\n", .{ runner.reads.load(.Unordered)});
+ //std.debug.print("reads={}\n", .{ runner.reads.load(.unordered)});
}