From: Russ Cox Date: Tue, 23 Jul 2013 18:43:55 +0000 (-0400) Subject: misc/cgo/test: test recursive internal OS thread lock X-Git-Tag: go1.2rc2~966 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=4d17efe81b88b0ffacb74986d2558e9098afdded;p=gostls13.git misc/cgo/test: test recursive internal OS thread lock This would have failed with CL 11663043. R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/11480045 --- diff --git a/misc/cgo/test/issue3775.go b/misc/cgo/test/issue3775.go index c05a5d4be8..8f81854195 100644 --- a/misc/cgo/test/issue3775.go +++ b/misc/cgo/test/issue3775.go @@ -15,6 +15,14 @@ import ( "testing" ) +func init() { + // Same as test3775 but run during init so that + // there are two levels of internal runtime lock + // (1 for init, 1 for cgo). + // This would have been broken by CL 11663043. + C.lockOSThreadC() +} + func test3775(t *testing.T) { // Used to panic because of the UnlockOSThread below. C.lockOSThreadC()