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