]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: move m.thread to mOS
authorAustin Clements <austin@google.com>
Tue, 19 Nov 2019 01:07:11 +0000 (20:07 -0500)
committerAustin Clements <austin@google.com>
Wed, 20 Nov 2019 17:13:36 +0000 (17:13 +0000)
This field is only used on Windows.

Change-Id: I12d4df09261f8e7ad54c2abd7beda669af28c8e7
Reviewed-on: https://go-review.googlesource.com/c/go/+/207778
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
src/runtime/os_windows.go
src/runtime/runtime2.go

index 58e13acb1f2a416f29caf275016320a85b4844b3..b4df08322ca3b821322338bc6992f82123bcbe3d 100644 (file)
@@ -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
 }
index fe1147e2471baada0b6ea5b8d01fbf0e2a294a18..3f9e51c5288562b1b18c17cc1c0cc748fc4256f6 100644 (file)
@@ -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.