From 5f35dc0c0d0530d5a1d028c56a763def3d1fd250 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Wed, 24 Feb 2021 21:29:01 -0700 Subject: zig fmt the std lib --- lib/std/Thread.zig | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) (limited to 'lib/std/Thread.zig') diff --git a/lib/std/Thread.zig b/lib/std/Thread.zig index ea878bbdb0..80de19fe19 100644 --- a/lib/std/Thread.zig +++ b/lib/std/Thread.zig @@ -70,16 +70,8 @@ else switch (std.Target.current.os.tag) { /// Signals the processor that it is inside a busy-wait spin-loop ("spin lock"). pub fn spinLoopHint() void { switch (std.Target.current.cpu.arch) { - .i386, .x86_64 => asm volatile ("pause" - : - : - : "memory" - ), - .arm, .aarch64 => asm volatile ("yield" - : - : - : "memory" - ), + .i386, .x86_64 => asm volatile ("pause" ::: "memory"), + .arm, .aarch64 => asm volatile ("yield" ::: "memory"), else => {}, } } @@ -90,12 +82,11 @@ pub fn spinLoopHint() void { pub fn getCurrentId() Id { if (use_pthreads) { return c.pthread_self(); - } else - return switch (std.Target.current.os.tag) { - .linux => os.linux.gettid(), - .windows => windows.kernel32.GetCurrentThreadId(), - else => @compileError("Unsupported OS"), - }; + } else return switch (std.Target.current.os.tag) { + .linux => os.linux.gettid(), + .windows => windows.kernel32.GetCurrentThreadId(), + else => @compileError("Unsupported OS"), + }; } /// Returns the handle of this thread. -- cgit v1.2.3