authorgravatar for kbutcher6200@gmail.comkprotty <kbutcher6200@gmail.com> 2021-06-25 12:43:03-05:00
committergravatar for kbutcher6200@gmail.comkprotty <kbutcher6200@gmail.com> 2021-06-30 21:49:00-05:00
log009c95b8ec2f19f6d0db25c9284a7f79a07c387f
tree6f696a861dbeb8d64a4269adbe85616ee3152bcd
parent5f4a40e6aa7709fe708f9b20b32f63a50cc64736

std.Thread: more fixes


2 files changed, 11 insertions(+), 11 deletions(-)

lib/std/Thread.zig+10-10
......@@ -397,17 +397,17 @@ const PosixThreadImpl = struct {
397397 assert(c.pthread_attr_setguardsize(&attr, std.mem.page_size) == 0);
398398
399399 var handle: c.pthread_t = undefined;
400 return switch (c.pthread_create(
400 switch (c.pthread_create(
401401 &handle,
402402 &attr,
403403 Instance.entryFn,
404404 @ptrCast(*c_void, args_ptr),
405405 )) {
406 0 => .{ .handle = handle },
407 os.EAGAIN => error.SystemResources,
406 0 => return Impl{ .handle = handle },
407 os.EAGAIN => return error.SystemResources,
408408 os.EPERM => unreachable,
409409 os.EINVAL => unreachable,
410 else => |err| os.unexpectedErrno(err),
410 else => |err| return os.unexpectedErrno(err),
411411 };
412412 }
413413
......@@ -563,7 +563,7 @@ const LinuxThreadImpl = struct {
563563 os.CLONE_PARENT_SETTID | os.CLONE_CHILD_CLEARTID |
564564 os.CLONE_DETACHED | os.CLONE_SETTLS;
565565
566 return switch (linux.getErrno(linux.clone(
566 switch (linux.getErrno(linux.clone(
567567 Instance.entryFn,
568568 @ptrToInt(&mapped[stack_offset]),
569569 flags,
......@@ -572,14 +572,14 @@ const LinuxThreadImpl = struct {
572572 tls_ptr,
573573 &instance.thread.child_tid.value,
574574 ))) {
575 0 => .{ .thread = &instance.thread },
576 os.EAGAIN => error.ThreadQuotaExceeded,
575 0 => return Impl{ .thread = &instance.thread },
576 os.EAGAIN => return error.ThreadQuotaExceeded,
577577 os.EINVAL => unreachable,
578 os.ENOMEM => error.SystemResources,
578 os.ENOMEM => return error.SystemResources,
579579 os.ENOSPC => unreachable,
580580 os.EPERM => unreachable,
581581 os.EUSERS => unreachable,
582 else => |err| os.unexpectedErrno(err),
582 else => |err| return os.unexpectedErrno(err),
583583 };
584584 }
585585
......@@ -655,7 +655,7 @@ const LinuxThreadImpl = struct {
655655 \\ movl $60, %eax
656656 \\ syscall
657657 ),
658 .arm, .armeb, .thumb, .thumb_eb => (
658 .arm, .armeb, .thumb, .thumbeb => (
659659 \\.syntax unified
660660 \\.text
661661 \\.global __unmap_and_exit
lib/std/os/test.zig+1-1
......@@ -372,7 +372,7 @@ test "thread local storage" {
372372 if (builtin.single_threaded) return error.SkipZigTest;
373373 const thread1 = try Thread.spawn(.{}, testTls, .{});
374374 const thread2 = try Thread.spawn(.{}, testTls, .{});
375 try testTls({});
375 try testTls();
376376 thread1.join();
377377 thread2.join();
378378}