Source file
misc/cgo/test/sigprocmask.go
1
2
3
4
5
6
7
8 package cgotest
9
10
16 import "C"
17 import (
18 "os"
19 "os/signal"
20 "syscall"
21 "testing"
22 )
23
24 var blocked bool
25
26
27 func IntoGoAndBack() {
28
29
30 signal.Notify(make(chan os.Signal), syscall.SIGIO)
31 blocked = C.CheckBlocked() != 0
32 }
33
34 func testSigprocmask(t *testing.T) {
35 if r := C.RunSigThread(); r != 0 {
36 t.Errorf("pthread_create/pthread_join failed: %d", r)
37 }
38 if !blocked {
39 t.Error("Go runtime unblocked SIGIO")
40 }
41 }
42
View as plain text