1 // Copyright 2015 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 extern void IntoGoAndBack();
19 sigprocmask(SIG_BLOCK, NULL, &mask);
20 return sigismember(&mask, SIGIO);
23 static void* sigthreadfunc(void* unused) {
26 sigaddset(&mask, SIGIO);
27 sigprocmask(SIG_BLOCK, &mask, NULL);
38 for (tries = 0; tries < 20; tries++) {
39 r = pthread_create(&thread, NULL, &sigthreadfunc, NULL);
41 return pthread_join(thread, NULL);
47 ts.tv_nsec = (tries + 1) * 1000 * 1000; // Milliseconds.