1 // Copyright 2013 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.
15 static void *thread(void *p) {
19 for (i = 0; i < M; i++) {
20 pthread_kill(pthread_self(), SIGCHLD);
21 usleep(rand() % 20 + 5);
29 for (i = 0; i < N; i++) {
30 usleep(rand() % 200 + 100);
31 pthread_create(&tid[i], 0, thread, NULL);
33 for (i = 0; i < N; i++)
34 pthread_join(tid[i], 0);
47 func test3250(t *testing.T) {
48 t.Skip("skipped, see golang.org/issue/5885")
58 sigCh = make(chan os.Signal, 10)
59 waitStart = make(chan struct{})
60 waitDone = make(chan result)
63 signal.Notify(sigCh, sig)
67 alarm := time.After(time.Second * 3)
74 if v != sig || n > thres {
75 waitDone <- result{n, v}
79 waitDone <- result{n, sig}
85 waitStart <- struct{}{}
89 t.Fatalf("received signal %v, but want %v", r.sig, sig)
91 t.Logf("got %d signals\n", r.n)
93 t.Fatalf("expected more than %d", thres)