1 // Copyright 2014 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
7 // Test that pthread_cancel works as expected
8 // (NPTL uses SIGRTMIN to implement thread cancellation)
9 // See https://golang.org/issue/6997
14 #cgo LDFLAGS: -pthread
15 extern int StartThread();
16 extern int CancelThread();
25 func test6997(t *testing.T) {
28 t.Error("pthread_create failed")
32 time.Sleep(500 * time.Millisecond)
39 t.Error("pthread finished but wasn't canceled??")
41 case <-time.After(30 * time.Second):
42 t.Error("hung in pthread_cancel/pthread_join")