diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-11-13 03:06:55 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-11-13 03:06:55 +0000 |
| commit | 8bae70454dabe77dfe7e5344e59ca2180d63af51 (patch) | |
| tree | bfb8f584993bf720414f5ab493b42aadd3c24e72 /lib/std/os/linux.zig | |
| parent | 32b37e695aa0581b863a395e0a28b7b4aa76c07d (diff) | |
| parent | 41914321b4593e3ed246cadda705e1076ab670d7 (diff) | |
| download | zig-8bae70454dabe77dfe7e5344e59ca2180d63af51.tar.gz zig-8bae70454dabe77dfe7e5344e59ca2180d63af51.zip | |
Merge pull request #3675 from Vexu/atomic-store
Add @atomicStore builtin
Diffstat (limited to 'lib/std/os/linux.zig')
| -rw-r--r-- | lib/std/os/linux.zig | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/std/os/linux.zig b/lib/std/os/linux.zig index 618a21f456..7e2f14021f 100644 --- a/lib/std/os/linux.zig +++ b/lib/std/os/linux.zig @@ -531,7 +531,7 @@ extern fn init_vdso_clock_gettime(clk: i32, ts: *timespec) usize { const ptr = @intToPtr(?*const c_void, vdso.lookup(VDSO_CGT_VER, VDSO_CGT_SYM)); // Note that we may not have a VDSO at all, update the stub address anyway // so that clock_gettime will fall back on the good old (and slow) syscall - _ = @cmpxchgStrong(?*const c_void, &vdso_clock_gettime, &init_vdso_clock_gettime, ptr, .Monotonic, .Monotonic); + @atomicStore(?*const c_void, &vdso_clock_gettime, ptr, .Monotonic); // Call into the VDSO if available if (ptr) |fn_ptr| { const f = @ptrCast(vdso_clock_gettime_ty, fn_ptr); |
