From 91bb1d734ecb44f687f3549ace10ee8f70e977a8 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Mon, 18 Nov 2019 20:07:11 -0500 Subject: [PATCH] runtime: move m.thread to mOS This field is only used on Windows. Change-Id: I12d4df09261f8e7ad54c2abd7beda669af28c8e7 Reviewed-on: https://go-review.googlesource.com/c/go/+/207778 Run-TryBot: Austin Clements TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick Reviewed-by: Cherry Zhang Reviewed-by: Alex Brainman --- src/runtime/os_windows.go | 2 ++ src/runtime/runtime2.go | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/runtime/os_windows.go b/src/runtime/os_windows.go index 58e13acb1f..b4df08322c 100644 --- a/src/runtime/os_windows.go +++ b/src/runtime/os_windows.go @@ -143,6 +143,8 @@ func tstart_stdcall(newm *m) func ctrlhandler() type mOS struct { + thread uintptr // thread handle; accessed atomically + waitsema uintptr // semaphore for parking on locks resumesema uintptr // semaphore to indicate suspend/resume } diff --git a/src/runtime/runtime2.go b/src/runtime/runtime2.go index fe1147e247..3f9e51c528 100644 --- a/src/runtime/runtime2.go +++ b/src/runtime/runtime2.go @@ -522,8 +522,7 @@ type m struct { waittraceskip int startingtrace bool syscalltick uint32 - thread uintptr // thread handle - freelink *m // on sched.freem + freelink *m // on sched.freem // these are here because they are too large to be on the stack // of low-level NOSPLIT functions. -- 2.50.0