aboutsummaryrefslogtreecommitdiff
path: root/lib/std/Thread.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2021-09-15 14:46:31 -0700
committerAndrew Kelley <andrew@ziglang.org>2021-09-15 14:51:08 -0700
commitf3ebfcae3882c03da84821abed40167ea07a8c78 (patch)
treef1b759c94cba5b020a9ffb141fc62cb686fc5f04 /lib/std/Thread.zig
parent111a2dcf3ad53c0c8ad2c9e7c9bd042b81e90c82 (diff)
parent0395b35cee8d4082cc40b0dcd0298f797f42309d (diff)
downloadzig-f3ebfcae3882c03da84821abed40167ea07a8c78.tar.gz
zig-f3ebfcae3882c03da84821abed40167ea07a8c78.zip
Merge remote-tracking branch 'origin/master' into llvm13
Conflicts: * cmake/Findclang.cmake * cmake/Findlld.cmake * cmake/Findllvm.cmake In master branch, more search paths were added to these files with "12" in the path. In this commit I updated them to "13". * src/stage1/codegen.cpp * src/zig_llvm.cpp * src/zig_llvm.h In master branch, ZigLLVMBuildCmpXchg is improved to add `is_single_threaded`. However, the LLVM 13 C API has this already, and in the llvm13 branch, ZigLLVMBuildCmpXchg is deleted in favor of the C API. In this commit I updated stage2 to use the LLVM 13 C API rather than depending on an improved ZigLLVMBuildCmpXchg. Additionally, src/target.zig largestAtomicBits needed to be updated to include the new m68k ISA.
Diffstat (limited to 'lib/std/Thread.zig')
-rw-r--r--lib/std/Thread.zig18
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/std/Thread.zig b/lib/std/Thread.zig
index e322485037..1fe8ca89d2 100644
--- a/lib/std/Thread.zig
+++ b/lib/std/Thread.zig
@@ -558,7 +558,7 @@ const PosixThreadImpl = struct {
.openbsd => {
var count: c_int = undefined;
var count_size: usize = @sizeOf(c_int);
- const mib = [_]c_int{ os.CTL_HW, os.HW_NCPUONLINE };
+ const mib = [_]c_int{ os.CTL.HW, os.system.HW_NCPUONLINE };
os.sysctl(&mib, &count, &count_size, null, 0) catch |err| switch (err) {
error.NameTooLong, error.UnknownName => unreachable,
else => |e| return e,
@@ -877,8 +877,8 @@ const LinuxThreadImpl = struct {
const mapped = os.mmap(
null,
map_bytes,
- os.PROT_NONE,
- os.MAP_PRIVATE | os.MAP_ANONYMOUS,
+ os.PROT.NONE,
+ os.MAP.PRIVATE | os.MAP.ANONYMOUS,
-1,
0,
) catch |err| switch (err) {
@@ -893,7 +893,7 @@ const LinuxThreadImpl = struct {
// map everything but the guard page as read/write
os.mprotect(
mapped[guard_offset..],
- os.PROT_READ | os.PROT_WRITE,
+ os.PROT.READ | os.PROT.WRITE,
) catch |err| switch (err) {
error.AccessDenied => unreachable,
else => |e| return e,
@@ -923,10 +923,10 @@ const LinuxThreadImpl = struct {
.thread = .{ .mapped = mapped },
};
- const flags: u32 = os.CLONE_THREAD | os.CLONE_DETACHED |
- os.CLONE_VM | os.CLONE_FS | os.CLONE_FILES |
- os.CLONE_PARENT_SETTID | os.CLONE_CHILD_CLEARTID |
- os.CLONE_SIGHAND | os.CLONE_SYSVSEM | os.CLONE_SETTLS;
+ const flags: u32 = linux.CLONE.THREAD | linux.CLONE.DETACHED |
+ linux.CLONE.VM | linux.CLONE.FS | linux.CLONE.FILES |
+ linux.CLONE.PARENT_SETTID | linux.CLONE.CHILD_CLEARTID |
+ linux.CLONE.SIGHAND | linux.CLONE.SYSVSEM | linux.CLONE.SETTLS;
switch (linux.getErrno(linux.clone(
Instance.entryFn,
@@ -978,7 +978,7 @@ const LinuxThreadImpl = struct {
switch (linux.getErrno(linux.futex_wait(
&self.thread.child_tid.value,
- linux.FUTEX_WAIT,
+ linux.FUTEX.WAIT,
tid,
null,
))) {