aboutsummaryrefslogtreecommitdiff
path: root/std/os
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2018-04-15 18:12:00 -0400
committerAndrew Kelley <superjoe30@gmail.com>2018-04-15 18:12:00 -0400
commitb9360640cefd1aa30dedf71a0c6b7bddc51a6ae3 (patch)
tree89c751d93d98bee02e77fd7ac015845f398d8afd /std/os
parent859b10d8bfcca3c4a30798b4522fd88ec6c66de6 (diff)
downloadzig-b9360640cefd1aa30dedf71a0c6b7bddc51a6ae3.tar.gz
zig-b9360640cefd1aa30dedf71a0c6b7bddc51a6ae3.zip
add @atomicLoad builtin
See #174
Diffstat (limited to 'std/os')
-rw-r--r--std/os/index.zig2
1 files changed, 1 insertions, 1 deletions
diff --git a/std/os/index.zig b/std/os/index.zig
index 15b54f2e98..dbdb8c90cd 100644
--- a/std/os/index.zig
+++ b/std/os/index.zig
@@ -2392,7 +2392,7 @@ pub const Thread = struct {
pub fn wait(self: &const Thread) void {
while (true) {
- const pid_value = self.pid; // TODO atomic load
+ const pid_value = @atomicLoad(i32, &self.pid, builtin.AtomicOrder.SeqCst);
if (pid_value == 0) break;
const rc = linux.futex_wait(@ptrToInt(&self.pid), linux.FUTEX_WAIT, pid_value, null);
switch (linux.getErrno(rc)) {