Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for IntoGoAndBack (0.09 sec)

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

    #cgo LDFLAGS: -pthread
    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

    #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);
    	sigprocmask(SIG_BLOCK, &mask, NULL);
    	IntoGoAndBack();
    	return NULL;
    }
    
    int RunSigThread() {
    	int tries;
    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