changind atomic operations order
This commit is contained in:
@@ -43,25 +43,25 @@ pub fn destroy(interface: *Interface, allocator: std.mem.Allocator) void {
|
||||
|
||||
pub fn getStatus(interface: *Interface) VkError!void {
|
||||
const self: *Self = @alignCast(@fieldParentPtr("interface", interface));
|
||||
if (!self.is_signaled.load(.acquire)) {
|
||||
if (!self.is_signaled.load(.seq_cst)) {
|
||||
return VkError.NotReady;
|
||||
}
|
||||
}
|
||||
|
||||
pub fn reset(interface: *Interface) VkError!void {
|
||||
const self: *Self = @alignCast(@fieldParentPtr("interface", interface));
|
||||
self.is_signaled.store(false, .monotonic);
|
||||
self.is_signaled.store(false, .seq_cst);
|
||||
}
|
||||
|
||||
pub fn signal(interface: *Interface) VkError!void {
|
||||
const self: *Self = @alignCast(@fieldParentPtr("interface", interface));
|
||||
self.is_signaled.store(true, .monotonic);
|
||||
self.is_signaled.store(true, .seq_cst);
|
||||
self.condition.broadcast();
|
||||
}
|
||||
|
||||
pub fn wait(interface: *Interface, timeout: u64) VkError!void {
|
||||
const self: *Self = @alignCast(@fieldParentPtr("interface", interface));
|
||||
if (self.is_signaled.load(.acquire)) return;
|
||||
if (self.is_signaled.load(.seq_cst)) return;
|
||||
if (timeout == 0) return VkError.Timeout;
|
||||
|
||||
self.mutex.lock();
|
||||
|
||||
Reference in New Issue
Block a user