]> Cypherpunks.ru repositories - gostls13.git/blobdiff - src/runtime/proc.go
[dev.garbage] all: merge dev.cc (493ad916c3b1) into dev.garbage
[gostls13.git] / src / runtime / proc.go
index 12e2e71e999f4fd51979d0ffe6f0d661da8bcff6..64f6a352091f9b8b29e9a30574124fd33148b4cd 100644 (file)
@@ -63,11 +63,13 @@ func main() {
                if _cgo_free == nil {
                        gothrow("_cgo_free missing")
                }
-               if _cgo_setenv == nil {
-                       gothrow("_cgo_setenv missing")
-               }
-               if _cgo_unsetenv == nil {
-                       gothrow("_cgo_unsetenv missing")
+               if GOOS != "windows" {
+                       if _cgo_setenv == nil {
+                               gothrow("_cgo_setenv missing")
+                       }
+                       if _cgo_unsetenv == nil {
+                               gothrow("_cgo_unsetenv missing")
+                       }
                }
        }
 
@@ -165,6 +167,7 @@ func acquireSudog() *sudog {
                        gothrow("acquireSudog: found s.elem != nil in cache")
                }
                c.sudogcache = s.next
+               s.next = nil
                return s
        }
 
@@ -193,6 +196,15 @@ func releaseSudog(s *sudog) {
        if s.selectdone != nil {
                gothrow("runtime: sudog with non-nil selectdone")
        }
+       if s.next != nil {
+               gothrow("runtime: sudog with non-nil next")
+       }
+       if s.prev != nil {
+               gothrow("runtime: sudog with non-nil prev")
+       }
+       if s.waitlink != nil {
+               gothrow("runtime: sudog with non-nil waitlink")
+       }
        gp := getg()
        if gp.param != nil {
                gothrow("runtime: releaseSudog with non-nil gp.param")