std.Thread: fix futex test + thread errors

This commit is contained in:
kprotty
2021-06-26 09:03:53 -05:00
parent 18bcb2e990
commit fd4a607bb2
2 changed files with 90 additions and 98 deletions

View File

@@ -385,6 +385,7 @@ const PosixThreadImpl = struct {
};
const args_ptr = try allocator.create(Args);
args_ptr.* = args;
errdefer allocator.destroy(args_ptr);
var attr: c.pthread_attr_t = undefined;
@@ -523,6 +524,7 @@ const LinuxThreadImpl = struct {
error.PermissionDenied => unreachable,
else => |e| return e,
};
assert(mapped.len >= map_bytes);
errdefer os.munmap(mapped);
// map everything but the guard page as read/write