1
0
mirror of https://github.com/golang/go synced 2024-11-15 09:10:22 -07:00
go/test/fixedbugs/bug429.go
Russ Cox 5eb007dede runtime: work around false negative in deadlock detection
Not a complete fix for issue 3342, but fixes the trivial case.
There may still be a race in the instants before and after
a scavenger-induced garbage collection.

Intended to be "obviously safe": a call to runtime·gosched
before main.main is no different than a call to runtime.Gosched
at the beginning of main.main, and it is (or had better be)
safe to call runtime.Gosched at any point during main.

Update #3342.

R=iant
CC=golang-dev
https://golang.org/cl/5919052
2012-03-27 12:22:19 -04:00

14 lines
309 B
Go

// $G $D/$F.go && $L $F.$A && ! ./$A.out || echo BUG: bug429
// Copyright 2012 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Should print deadlock message, not hang.
package main
func main() {
select {}
}