changind atomic operations order

This commit is contained in:
2025-12-10 07:39:21 +01:00
parent 359843acdb
commit 7e19ba2fdd
2 changed files with 7 additions and 7 deletions

View File

@@ -7,11 +7,11 @@ count: std.atomic.Value(usize),
pub const init: Self = .{ .count = std.atomic.Value(usize).init(0) };
pub inline fn ref(self: *Self) void {
_ = self.count.fetchAdd(1, .monotonic);
_ = self.count.fetchAdd(1, .seq_cst);
}
pub inline fn unref(self: *Self) void {
_ = self.count.fetchSub(1, .monotonic);
_ = self.count.fetchSub(1, .seq_cst);
}
pub inline fn hasRefs(self: *Self) bool {
@@ -19,5 +19,5 @@ pub inline fn hasRefs(self: *Self) bool {
}
pub inline fn getRefsCount(self: *Self) usize {
return self.count.load(.acquire);
return self.count.load(.seq_cst);
}