Function fence [src]
Prototype
pub fn fence( self: *WipFunction, sync_scope: SyncScope, ordering: AtomicOrdering, ) Allocator.Error!Instruction.Index Parameters
self: *WipFunctionsync_scope: SyncScopeordering: AtomicOrdering Source
pub fn fence(
self: *WipFunction,
sync_scope: SyncScope,
ordering: AtomicOrdering,
) Allocator.Error!Instruction.Index {
assert(ordering != .none);
try self.ensureUnusedExtraCapacity(1, NoExtra, 0);
const instruction = try self.addInst(null, .{
.tag = .fence,
.data = @bitCast(MemoryAccessInfo{
.sync_scope = sync_scope,
.success_ordering = ordering,
}),
});
return instruction;
}