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.
5
// Test that pthread_cancel works as expected
6
// (NPTL uses SIGRTMIN to implement thread cancellation)
7
// See http://golang.org/issue/6997
12
#cgo LDFLAGS: -pthread
13
extern int StartThread();
14
extern int CancelThread();
21
func test6997(t *testing.T) {
24
t.Error("pthread_create failed")
28
time.Sleep(500 * time.Millisecond)
35
t.Error("pthread finished but wasn't cancelled??")
37
case <-time.After(5 * time.Second):
38
t.Error("hung in pthread_cancel/pthread_join")