Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for CheckBlocked (0.14 sec)

  1. src/cmd/cgo/internal/test/sigprocmask.go

    extern int RunSigThread();
    extern int CheckBlocked();
    */
    import "C"
    import (
    	"os"
    	"os/signal"
    	"syscall"
    	"testing"
    )
    
    var blocked bool
    
    //export IntoGoAndBack
    func IntoGoAndBack() {
    	// Verify that SIGIO stays blocked on the C thread
    	// even when unblocked for signal.Notify().
    	signal.Notify(make(chan os.Signal), syscall.SIGIO)
    	blocked = C.CheckBlocked() != 0
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 12 12:00:02 UTC 2023
    - 808 bytes
    - Viewed (0)
  2. src/cmd/cgo/internal/test/sigprocmask.c

    //go:build !windows
    
    #include <errno.h>
    #include <signal.h>
    #include <stdlib.h>
    #include <pthread.h>
    #include <stdio.h>
    #include <time.h>
    #include <unistd.h>
    
    extern void IntoGoAndBack();
    
    int CheckBlocked() {
    	sigset_t mask;
    	sigprocmask(SIG_BLOCK, NULL, &mask);
    	return sigismember(&mask, SIGIO);
    }
    
    static void* sigthreadfunc(void* unused) {
    	sigset_t mask;
    	sigemptyset(&mask);
    	sigaddset(&mask, SIGIO);
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 12 12:00:02 UTC 2023
    - 1K bytes
    - Viewed (0)
Back to top