mirror of
https://github.com/ziglang/zig.git
synced 2024-11-17 01:23:54 +00:00
compiler_rt: atomics: Formatting change for flag definition
This commit is contained in:
parent
5b283fba77
commit
fac2a2e754
@ -54,14 +54,15 @@ const SpinlockTable = struct {
|
||||
|
||||
fn acquire(self: *@This()) void {
|
||||
while (true) {
|
||||
const flag = if (comptime arch.isSPARC())
|
||||
asm volatile ("ldstub [%[addr]], %[flag]"
|
||||
const flag = if (comptime arch.isSPARC()) flag: {
|
||||
break :flag asm volatile ("ldstub [%[addr]], %[flag]"
|
||||
: [flag] "=r" (-> @TypeOf(self.v)),
|
||||
: [addr] "r" (&self.v),
|
||||
: "memory"
|
||||
)
|
||||
else
|
||||
@atomicRmw(@TypeOf(self.v), &self.v, .Xchg, .Locked, .Acquire);
|
||||
);
|
||||
} else flag: {
|
||||
break :flag @atomicRmw(@TypeOf(self.v), &self.v, .Xchg, .Locked, .Acquire);
|
||||
};
|
||||
|
||||
switch (flag) {
|
||||
.Unlocked => break,
|
||||
|
Loading…
Reference in New Issue
Block a user