Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(307)

Unified Diff: src/pkg/runtime/crash_test.go

Issue 7393063: code review 7393063: cmd/go: fix "go run" cgo source when cgo is disabled (Closed)
Patch Set: diff -r 38b1893be35d https://code.google.com/p/go/ Created 12 years ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/pkg/runtime/crash_cgo_test.go ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pkg/runtime/crash_test.go
===================================================================
--- a/src/pkg/runtime/crash_test.go
+++ b/src/pkg/runtime/crash_test.go
@@ -99,14 +99,6 @@
testDeadlock(t, lockedDeadlockSource2)
}
-func TestCgoSignalDeadlock(t *testing.T) {
- got := executeTest(t, cgoSignalDeadlockSource, nil)
- want := "OK\n"
- if got != want {
- t.Fatalf("expected %q, but got %q", want, got)
- }
-}
-
const crashSource = `
package main
@@ -191,68 +183,3 @@
select {}
}
`
-
-const cgoSignalDeadlockSource = `
-package main
-
-import "C"
-
-import (
- "fmt"
- "runtime"
- "time"
-)
-
-func main() {
- runtime.GOMAXPROCS(100)
- ping := make(chan bool)
- go func() {
- for i := 0; ; i++ {
- runtime.Gosched()
- select {
- case done := <-ping:
- if done {
- ping <- true
- return
- }
- ping <- true
- default:
- }
- func() {
- defer func() {
- recover()
- }()
- var s *string
- *s = ""
- }()
- }
- }()
- time.Sleep(time.Millisecond)
- for i := 0; i < 64; i++ {
- go func() {
- runtime.LockOSThread()
- select {}
- }()
- go func() {
- runtime.LockOSThread()
- select {}
- }()
- time.Sleep(time.Millisecond)
- ping <- false
- select {
- case <-ping:
- case <-time.After(time.Second):
- fmt.Printf("HANG\n")
- return
- }
- }
- ping <- true
- select {
- case <-ping:
- case <-time.After(time.Second):
- fmt.Printf("HANG\n")
- return
- }
- fmt.Printf("OK\n")
-}
-`
« no previous file with comments | « src/pkg/runtime/crash_cgo_test.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b