diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2020-01-06 18:53:17 -0500 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2020-01-06 18:53:17 -0500 |
| commit | 633b6bf92055a62f8a18dbfdb1ddc4f7330bf4ec (patch) | |
| tree | 3be9c09b1e6c0c3aff43fdc3d6d98948756de023 /lib/std/spinlock.zig | |
| parent | 4e6ad8efd9fcefb820acf4a03fc4ab9157f85c1b (diff) | |
| parent | c0e8837ce9168088e89bfeef9516d7318cd5f97d (diff) | |
| download | zig-633b6bf92055a62f8a18dbfdb1ddc4f7330bf4ec.tar.gz zig-633b6bf92055a62f8a18dbfdb1ddc4f7330bf4ec.zip | |
Merge branch 'LemonBoy-cc-work'
Diffstat (limited to 'lib/std/spinlock.zig')
| -rw-r--r-- | lib/std/spinlock.zig | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/std/spinlock.zig b/lib/std/spinlock.zig index 4efd244367..1a3239a95c 100644 --- a/lib/std/spinlock.zig +++ b/lib/std/spinlock.zig @@ -60,8 +60,16 @@ pub const SpinLock = struct { switch (builtin.arch) { // these instructions use a memory clobber as they // flush the pipeline of any speculated reads/writes. - .i386, .x86_64 => asm volatile ("pause" ::: "memory"), - .arm, .aarch64 => asm volatile ("yield" ::: "memory"), + .i386, .x86_64 => asm volatile ("pause" + : + : + : "memory" + ), + .arm, .aarch64 => asm volatile ("yield" + : + : + : "memory" + ), else => std.os.sched_yield() catch {}, } } |
